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

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'}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

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!