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

Locking fails with ModuleNotFoundError for distutils #6359

Open
GPHemsley-RELX opened this issue Mar 15, 2025 · 1 comment
Open

Locking fails with ModuleNotFoundError for distutils #6359

GPHemsley-RELX opened this issue Mar 15, 2025 · 1 comment

Comments

@GPHemsley-RELX
Copy link

GPHemsley-RELX commented Mar 15, 2025

Possibly related:

Trying to update from Python 3.11 to 3.12. Created a new pipenv environment using a new pyenv version installation.

Python 3.12.9
pip 24.3.1
pipenv 2024.4.1

Trying to run pipenv lock results in an error of "metadata generation failed".

Trying to run pipenv run pip install pipenv (or any other package) results in:

Traceback (most recent call last):
  File "/.../bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/.../lib/python3.12/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/.../lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/.../lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/.../lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
    from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'

Running import distutils within the interactive interpreter results in the same error within the virtual environment, but works as expected after exiting the virtual environment.

@GPHemsley-RELX
Copy link
Author

It seems this is somehow related to having access-parser = "*" in the Pipfile. This library is currently at version 0.0.6; I don't know if <1.0 is messing with the calculation, but adding --pre doesn't change anything. Removing that requirement from the Pipfile allows pipenv lock to work, but not pipenv run pip install pipenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant