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
Missing distutils with pipx on 3.12 #1088
Comments
As a heads up, |
Same here, I also experience this problem with pipx. Oddly enough, when installing pyinfra in a separate manually-created virtualenv it works fine: Output$ pwd
/home/diazona/tmp/pyinfra
$ python3.12 -m venv venv
$ source venv/bin/activate
$ python -m pip install pyinfra
[...]
$ which pyinfra
/home/diazona/tmp/pyinfra/venv/bin/pyinfra
$ pyinfra --support
--> Support information:
If you are having issues with pyinfra or wish to make feature requests, please
check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
When adding an issue, be sure to include the following:
System: Linux
Platform: Linux-6.7.5-gentoo-x86_64-AMD_Ryzen_7_2700X_Eight-Core_Processor-with-glibc2.39
Release: 6.7.5-gentoo
Machine: x86_64
pyinfra: v2.9.2
Executable: /home/diazona/tmp/pyinfra/venv/bin/pyinfra
Python: 3.12.3 (CPython, GCC 12.2.0) I'm not sure why it doesn't happen with a regular virtualenv (I guess setuptools is getting pulled in somewhere), but in any case, having dealt with this problem in other packages, I think the fix should be simple: in |
Is there a workaround until the PR gets reviewed? |
Quoting comment from diazona above:
So the workaround is: don't use pipx ;-) |
For others who run into this issue: the latest release (v2.9.2) also doesn't work with Python 3.12.x, even when using poetry. I had to downgrade to Python 3.11.x before I could get it to successfully work. |
It works fine for me... $ python3.12 -m venv venv
$ source venv/bin/activate
$ python -m pip install pyinfra==2.9.2
[...]
$ pyinfra --support
--> Support information:
If you are having issues with pyinfra or wish to make feature requests, please
check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
When adding an issue, be sure to include the following:
System: Linux
Platform: Linux-6.7.5-gentoo-x86_64-AMD_Ryzen_7_2700X_Eight-Core_Processor-with-glibc2.39
Release: 6.7.5-gentoo
Machine: x86_64
pyinfra: v2.9.2
Executable: /home/diazona/tmp/pyinfra-test/venv/bin/pyinfra
Python: 3.12.3 (CPython, GCC 12.2.0) I've also found that in a Docker container created from the So I think all we can really say in general is that pyinfra sometimes doesn't work with Python 3.12. "Sometimes" meaning "if distutils/pkg_resources aren't available", but it seems like there are various circumstances in which that's the case and it's hard to give a simple general rule to identify those circumstances. It does seem to work in all cases with Python 3.11 or lower, so my preferred workaround is to just use Python 3.11. (The convenience of pipx is too much to give up 😄 and to be fair, this isn't pipx's fault.) |
Describe the bug
There appears to be no
distutils
package in Python 3.12.To Reproduce
Install via pipx and run anything.
Expected behavior
Either Python <3.12 should be enforced, and/or missing distutils circumvented.
Meta
pyinfra --support
: gives same error as above, missing distutils.pipx install pyinfra
on Fedora 40 and Python 3.12.FWIW, forcing 3.11 via
pipx install pyinfra --python /usr/bin/python3.11
leads to a working install.The text was updated successfully, but these errors were encountered: