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.

Error when updating setuptools

See original GitHub issue

I tried to install new setuptools. Its successfully intalled, but crashed after.

$ . /projects/project_name/venv/bin/activate && pip install -U setuptools==18.5
Collecting setuptools==18.5
/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading setuptools-18.5-py2.py3-none-any.whl (462kB)
Installing collected packages: setuptools
  Found existing installation: setuptools 0.6rc11
    Uninstalling setuptools-0.6rc11:
      Successfully uninstalled setuptools-0.6rc11
Successfully installed setuptools
Traceback (most recent call last):
  File "/projects/project_name/venv/bin/pip", line 8, in <module>
    load_entry_point('pip==7.1.2', 'console_scripts', 'pip')()
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/__init__.py", line 217, in main
    return command.main(cmd_args)
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/basecommand.py", line 248, in main
    pip_version_check(session)
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/utils/__init__.py", line 858, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 629, in __init__
    self.add_entry(entry)
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 685, in add_entry
    for dist in find_distributions(entry, True):
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2075, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1605, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1963, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1843, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/projects/project_name/venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1783, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/projects/project_name/venv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg'

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
oliparcolcommented, Dec 3, 2015

I just have the same exact bug with pip 7.1.2. The solution is to disable PIP update check:

$ pip install --disable-pip-version-check -U setuptools

Using this option removes the exception. The update check must try to load the old setuptools that have been removed during the upgrade.

With the latest pip, the stacktrace is:

Collecting setuptools
  Downloading http://pypi.XXX.fr/packages/3.5/s/setuptools/setuptools-18.7.1-py2.py3-none-any.whl (463kB)
    100% |████████████████████████████████| 466kB 30.4MB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 0.6rc11
    Uninstalling setuptools-0.6rc11:
      Successfully uninstalled setuptools-0.6rc11
Successfully installed setuptools
Traceback (most recent call last):
  File "/tmp/toto/bin/pip", line 8, in <module>
    load_entry_point('pip==7.1.2', 'console_scripts', 'pip')()
  File "/tmp/toto/lib/python2.7/site-packages/pip/__init__.py", line 217, in main
    return command.main(cmd_args)
  File "/tmp/toto/lib/python2.7/site-packages/pip/basecommand.py", line 248, in main
    pip_version_check(session)
  File "/tmp/toto/lib/python2.7/site-packages/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/tmp/toto/lib/python2.7/site-packages/pip/utils/__init__.py", line 858, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 629, in __init__
    self.add_entry(entry)
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 685, in add_entry
    for dist in find_distributions(entry, True):
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2075, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1605, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1963, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1843, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/tmp/toto/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1783, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/tmp/toto/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg'
0reactions
xavfernandezcommented, Mar 23, 2017

Closing as the issue seems to be resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sudo pip install setuptools --upgrade error - Stack Overflow
I am doing pip install setuptools --upgrade but getting error below. Installing collected packages: setuptools Found existing installation: setuptools 1.1.6 ...
Read more >
Error Updating SetupTools · Issue #2513 - GitHub
Error Installing SetupTools via upgrade Release: setuptools-51.1.0.post20201221 says "yanked" and its unclear why its still downloading and ...
Read more >
Error when updating conda packages: RemoveError
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment. It seems like anything to do with ...
Read more >
Error with update -- py-37-setuptools : r/OPNsenseFirewall
Anyone have this error? been using Opnsense for over 2 years and love it. ... >>> Missing package dependencies were detected. >>> Found...
Read more >
How to Fix the “python setup.py egg_info failed with error code ...
Other reasons for this error include the pip installer or the setup tools not being updated on their latest version. This problem can...
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