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.

Pipenv fails to install/upgrade setuptools after 2022.8.19 release. UBI9

See original GitHub issue

Issue description

After pipenv upgrade from 2022.8.17 to 2022.8.19 it fails to install setuptools (Before the upgrade it ignored the fresh setuptools version)

Issue was catched under registry.redhat.io/ubi9-minimal image ubuntu20.04 goes fine (ubi9-minimal hasn’t been changes for at least 2 weeks, the issue appeared right after the release 2022.8.19)

An error occurred while installing setuptools==65.2.0; python_version >= ‘3.7’ --hash=sha256:7f4bc85450898a09f76ebf28b72fa25bc7111f6c7d665d514a60bba9c75ef2a9 --hash=sha256:a3ca5857c89f82f5c9410e8508cb32f4872a3bafd4aa7ae122a24ca33bccc750 Installing initially failed dependencies… [pipenv.exceptions.InstallError]: Looking in indexes: https://aws:@.d.codeartifact.eu-central-1.amazonaws.com/pypi/pypi-store/simple/ [pipenv.exceptions.InstallError]: Collecting setuptools==65.2.0 [pipenv.exceptions.InstallError]: Using cached https://regulaforensics-958783758244.d.codeartifact.eu-central-1.amazonaws.com/pypi/pypi-store/simple/setuptools/65.2.0/setuptools-65.2.0-py3-none-any.whl (1.2 MB) [pipenv.exceptions.InstallError]: Installing collected packages: setuptools [pipenv.exceptions.InstallError]: Attempting uninstall: setuptools [pipenv.exceptions.InstallError]: Found existing installation: setuptools 63.4.1 [pipenv.exceptions.InstallError]: Uninstalling setuptools-63.4.1: [pipenv.exceptions.InstallError]: Successfully uninstalled setuptools-63.4.1 [pipenv.exceptions.InstallError]: Rolling back uninstall of setuptools [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/_distutils_hack/ [pipenv.exceptions.InstallError]: from /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/~distutils_hack [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/distutils-precedence.pth [pipenv.exceptions.InstallError]: from /tmp/pip-uninstall-pltegogd/distutils-precedence.pth [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/pkg_resources/ [pipenv.exceptions.InstallError]: from /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/~kg_resources [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools-63.4.1.dist-info/ [pipenv.exceptions.InstallError]: from /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/~etuptools-63.4.1.dist-info [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools-63.4.1.virtualenv [pipenv.exceptions.InstallError]: from /tmp/pip-uninstall-pltegogd/setuptools-63.4.1.virtualenv [pipenv.exceptions.InstallError]: Moving to /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools/ [pipenv.exceptions.InstallError]: from /root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/~etuptools [pipenv.exceptions.InstallError]: ERROR: Exception: [pipenv.exceptions.InstallError]: Traceback (most recent call last): [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/cli/base_command.py”, line 167, in exc_logging_wrapper [pipenv.exceptions.InstallError]: status = run_func(*args) [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/cli/req_command.py”, line 247, in wrapper [pipenv.exceptions.InstallError]: return func(self, options, args) [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/commands/install.py”, line 461, in run [pipenv.exceptions.InstallError]: installed = install_given_reqs( [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/req/init.py”, line 73, in install_given_reqs [pipenv.exceptions.InstallError]: requirement.install( [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/req/req_install.py”, line 753, in install [pipenv.exceptions.InstallError]: scheme = get_scheme( [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/locations/init.py”, line 250, in get_scheme [pipenv.exceptions.InstallError]: old = _distutils.get_scheme( [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/locations/_distutils.py”, line 141, in get_scheme [pipenv.exceptions.InstallError]: scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix) [pipenv.exceptions.InstallError]: File “/usr/local/lib/python3.9/site-packages/pipenv/patched/pip/_internal/locations/_distutils.py”, line 66, in distutils_scheme [pipenv.exceptions.InstallError]: obj = d.get_command_obj(“install”, create=True) [pipenv.exceptions.InstallError]: File “/root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools/_distutils/dist.py”, line 864, in get_command_obj [pipenv.exceptions.InstallError]: klass = self.get_command_class(command) [pipenv.exceptions.InstallError]: File “/root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools/dist.py”, line 954, in get_command_class [pipenv.exceptions.InstallError]: self.cmdclass[command] = cmdclass = ep.load() [pipenv.exceptions.InstallError]: File “/root/.local/share/virtualenvs/app2-I8iNYena/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/init.py”, line 194, in load [pipenv.exceptions.InstallError]: module = import_module(match.group(‘module’)) [pipenv.exceptions.InstallError]: File “/usr/lib64/python3.9/importlib/init.py”, line 127, in import_module [pipenv.exceptions.InstallError]: return _bootstrap._gcd_import(name[level:], package, level) [pipenv.exceptions.InstallError]: File “<frozen importlib._bootstrap>”, line 1030, in _gcd_import [pipenv.exceptions.InstallError]: File “<frozen importlib._bootstrap>”, line 1007, in _find_and_load [pipenv.exceptions.InstallError]: File “<frozen importlib._bootstrap>”, line 984, in _find_and_load_unlocked [pipenv.exceptions.InstallError]: ModuleNotFoundError: No module named ‘setuptools.command.install’ ERROR: Couldn’t install package: setuptools

Expected result

Describe what you expected.

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


Pipenv version: '2022.8.19'

Pipenv location: '/usr/local/lib/python3.9/site-packages/pipenv'

setuptools version: '65.2.0'

Python location: '/usr/bin/python3'

OS Name: 'posix'

User pip version: '22.2.2'

user Python installations found:

  • 3.9.10: /usr/bin/python3.9
  • 3.9.10: /usr/bin/python3
  • 3.9.10: /bin/python3.9
  • 3.9.10: /bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.9.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.10.102.1-microsoft-standard-WSL2',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Mar 2 00:30:59 UTC 2022',
 'python_full_version': '3.9.10',
 'python_version': '3.9',
 'sys_platform': 'linux'}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
AndreiPaulaucommented, Aug 23, 2022

Yep, that’s exactly what I faced with https://github.com/pypa/setuptools/discussions/3544

So summing up for those who faced the same issue - for now there are three options:

  • install/upgrade setuptools in advance, if you require security updates for example pipenv run pip install setuptools==65.2.0
  • stick to the 2022.8.17 release (if nothing else breaks your CI/Development)
  • remove setuptools from Pipfile/Pipfile.lock if possible and live with OS populated setuptools

Or wait for magic and accidental fix =)

Many thanks for your support!

0reactions
AndreiPaulaucommented, Aug 25, 2022

Hooray! Thanks Matt!

Read more comments on GitHub >

github_iconTop Results From Across the Web

sudo pip install setuptools --upgrade error - Stack Overflow
Try to upgrade manually: pip uninstall setuptools pip install setuptools. If it doesn't work, try: pip install --upgrade setuptools --user python.
Read more >
setuptools 3.6 - PyPI
Easily download, build, install, upgrade, and uninstall Python packages.
Read more >
Pipenv fails to install/upgrade setuptools after 2022.8.19 ...
Pipenv fails to install /upgrade setuptools after 2022.8.19 release. UBI9. This issue has been created since 2022-08-23.
Read more >
Pypa Pipenv Statistics & Issues - Codesti
Issue Title State Comments Created Date Updated... Adding Table of Contents To Readme File open 0 2022‑10‑15 2022‑10... A CI/CD Observability Solution Suggestion open 0...
Read more >
2020635 – pip install fails if the setuptools weak dep is not ...
To clarify things, only some packages fail to install with `pip install` if setuptools is not installed on the system. All of the...
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