15

I have recently moved over to using pipenv and every now and then I get the following error when trying to install packages:

$ pipenv lock --clear --verbose

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in

$ pipenv install social-auth-core

 line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable

$ python setup.py egg_info

(k, v) for k, v in attrs.items()
File "/home/user/.local/share/virtualenvs/django-app-VE-name/lib/python3.6/site-packages/setuptools/dist.py", line 367, in __init__ 
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points'

The github pages for the error have not been helpful, thank you

2
  • Have you activate your env? Commented Dec 14, 2018 at 14:08
  • yes I have @Walucas Commented Dec 14, 2018 at 14:48

1 Answer 1

7

I think these may be bugs that have been fixed in the latest pipenv. Are you using the latest versions of pipenv (and pip, setuptools, and wheel)?

Assuming you're using --user installs, you can upgrade and/or check with the following command:

$ pip install --user --upgrade --upgrade-strategy eager pipenv wheel
Requirement already up-to-date: pipenv in ./.local/lib/python3.6/site-packages (2018.11.26)
Requirement already up-to-date: wheel in ./.local/lib/python3.6/site-packages (0.32.3)
Requirement already up-to-date: setuptools>=36.2.1 in ./.local/lib/python3.6/site-packages (from pipenv) (40.6.3)
Requirement already up-to-date: virtualenv in ./.local/lib/python3.6/site-packages (from pipenv) (16.1.0)
Requirement already up-to-date: virtualenv-clone>=0.2.5 in ./.local/lib/python3.6/site-packages (from pipenv) (0.4.0)
Requirement already up-to-date: pip>=9.0.1 in ./.local/lib/python3.6/site-packages (from pipenv) (18.1)
Requirement already up-to-date: certifi in ./.local/lib/python3.6/site-packages (from pipenv) (2018.11.29)

Note: This should be run outside of your virtual environment, not while it's activated.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you Pi, I now get: from pkg_resources import Requirement ImportError: cannot import name 'Requirement'
This worked, I had messed up my ve. So running the above command and then recreating my ve. Thank you Pi!
DID not work at 1st, until I killed my ssh & re-ssh in. Then it magically worked. What duh? Anyway. Thank u!
@user6273920: That may be because of a stale PATH cache entry for "pip", if the upgrade changed the effective path. If you're using bash, you can explicitly refresh the cache with "hash -r".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.