-
-
Notifications
You must be signed in to change notification settings - Fork 640
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
ModuleNotFoundError: No module named 'distutils.util' #21697
Comments
@mdaffad is it correct to say you're only using 3.10-dev as a hack to ensure |
Thank you for your answer and related docs, @jsirois. After checking again, the python from pyenv without For your question
Yes, I want to filter out the I think there should be a dedicated documentation or note on pants regarding distutils requirement since debian is a major distribution. |
I am not a Pants maintainer; so I'll let one of them chime in on docs. Suffice it to say I disagree with your stance; moderate googling would have told you about the Debian issue. |
@mdaffad perhaps you don't understand - distutils is not a requirement. It's part of the Python stdlib. It should always be available. It's the Debian packaging here that is odd / broken, depending on your stance, for leaving it out. |
Thank you for your help, hope this discussion help others search result as well. For this case, i will use pyenv. |
Describe the bug
I tried to run
pants generate-lockfiles
, and the following error message appeared:After debugging, I found that it uses Python 3.10 from the /usr/bin path because I installed a Python interpreter that fulfills the interpreter constraints. I tried to resolve this by updating the search path to
search_path = ["<PYENV>", "<PYENV_LOCAL>"]
and settinginterpreter_constraints = ['>=3.10-dev,<3.12-dev']
. My goal is to use the Python interpreter installed via pyenv, which includes the distutils package. I installed the interpreter with the3.10-dev
version.My question:
intepreter_constraints = ['>=3.10,<3.12']
search_path = ["<PYENV_LOCAL>", "/usr/bin"]
<major>.<minor>-dev
version? When I useinterpreter_constraints = ['>=3.10-dev,<3.12-dev']
, it works without error, but there is no documentation explaining how to specify constraints for<major>.<minor>-dev
.Note:
I verified the constraint by adding version 3.10 via pyenv (without the -dev suffix), but it still properly selects the interpreter with -dev.Pants version
2.23.0
OS
Ubuntu 20.04
Additional info
May relevant information on python and python-bootstrap configuration
Old pants.toml
New pants.toml
The text was updated successfully, but these errors were encountered: