Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graceful handling of "ImportError: No module named pkg_resources" #138

Open
ghost opened this issue Jan 20, 2014 · 0 comments
Open

Graceful handling of "ImportError: No module named pkg_resources" #138

ghost opened this issue Jan 20, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2014

Originally reported by: sleepycal (Bitbucket: sleepycal, GitHub: Unknown)


The following problem happens sometimes when freezing/installing requirements between different distributions, with and without virtualenv.

ubuntu-precise$ virtualenv --no-site-packages /opt/venv
ubuntu-precise$ /opt/venv/bin/pip freeze > requirements.txt
ubuntu-precise$ cat requirements.txt
Django==1.5
distribute==0.7.3

debian-wheezy$ virtualenv --no-site-packages /opt/venv
debian-wheezy$ /opt/venv/bin/pip install -r requirements.txt

Traceback (most recent call last):
CommandExecutionError: Traceback (most recent call last):
  File "/opt/venv/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

This seems to be breaking because it's forcing a version of distribute which different than the one already installed seems to break things. However it's not clear why this happens in the first place, and feels quite user unfriendly (surely this should be handled more gracefully?)

The easiest fix is to remove the distribute line from requirements.txt, but it would be nice if this was handled better?

Any thoughts?


@ghost ghost added major bug labels Mar 29, 2016
jaraco added a commit that referenced this issue May 9, 2022
Optional fields are really optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants