question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing setuptools.egg-info crashes pip

See original GitHub issue

This has crashed deploys on at least 9 of our production servers in the last week. I’ve been struggling to create a reproducable use case but can’t, sometimes it’s fine, other times it really isn’t. Reproducable test case provided here. Any insight would be hugely appreciated!

Also worth noting that we’ve seen the same issue when running pip install --upgrade virtualenv so probably not package related?

$ pip install  --upgrade supervisor
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 232, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 339, in run
    requirement_set.prepare_files(finder)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 229, in prepare_files
    req_to_install.check_if_exists()
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 931, in check_if_exists
    self.satisfied_by = pkg_resources.get_distribution(self.req)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 461, in get_distribution
    dist = get_provider(dist)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 341, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 870, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 740, in resolve
    env = Environment(self.entries)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 927, in __init__
    self.scan(search_path)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 957, in scan
    self.add(dist)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 973, in add
    if self.can_add(dist) and dist.has_version():
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2658, in has_version
    self.version
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2466, in version
    for line in self._get_metadata(self.PKG_INFO):
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2510, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1927, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1921, in get_metadata
    with open(self.path,'rU') as f:
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/dist-packages/setuptools.egg-info'

$ echo $?
2

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
malcommented, Feb 25, 2015

After further investigation we’ve managed to consistently recreate this on a clean ubuntu 12.04 box like so (run as root):

#!/bin/sh

# Installs 0.6rc11 via 0.6.24-1ubuntu1
apt-get install -y python-setuptools

# Here we have some easy_install usage before our deploy logic
# decides if we need to execute the rest of the code below.

wget -O- https://bootstrap.pypa.io/get-pip.py | python
pip install --upgrade setuptools
pip install --upgrade virtualenv
0reactions
qwcodecommented, Mar 31, 2015

closing based on https://github.com/pypa/pip/issues/2438#issuecomment-87450508

if anyone wants to double confirm the develop branch fixes this (or doesn’t), please do, and post results.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"pip install unroll": "python setup.py egg_info" failed with error ...
This resolved my issue when trying to install pylint . lazy-object-proxy was failing to be installed: " error: [Errno 2] No such file...
Read more >
setuptools 3.4.1 - PyPI
Fixed a missing files problem when using Windows source distributions on non-Windows platforms, due to distutils not handling manifest file line endings ...
Read more >
Error appears when installing RIDE by Setuptools
When opening "ride.py", window "python.exe" appeared with crashing. ... writing entry points to setuptools.egg-info\entry_points.txt.
Read more >
Command python setup py egg info failed with error code 1 in ...
If it's already installed, try pip install --upgrade setuptools. If it's already up to date, check that the module ez_setup is not missing....
Read more >
command "python setup.py egg_info" failed with error code 1 ...
bratreader installation problem: command "python setup.py ... [Errno 2] No such file or directory: '/tmp/pip-JfVutP- build/setup.py' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found