poetry install
reports ModuleNotFoundError: No module named 'distutils.cmd'
#6651
-
IssueProblem
What I tried so far
What else can I do/try. I am not on Linux most of the time so I might easily miss something. |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 4 replies
-
Can you please try the following? poetry env remove --all
sudo apt-get install --reinstall python3-distutils
poetry install |
Beta Was this translation helpful? Give feedback.
-
Thank you for your super fast response!
|
Beta Was this translation helpful? Give feedback.
-
For one last sanity check, can you reinstall Poetry using the installer script? curl https://install.python-poetry.org | python3 - --uninstall
curl https://install.python-poetry.org | python3 - --version 1.2.1 |
Beta Was this translation helpful? Give feedback.
-
Did that, but... unfortunately...
|
Beta Was this translation helpful? Give feedback.
-
Ah, also, looking closer, your project environment is using Python 3.9. Where is Python 3.9 installed from? |
Beta Was this translation helpful? Give feedback.
-
Actually I don't know. Ubuntu came with 3.10. During the first |
Beta Was this translation helpful? Give feedback.
-
Try finding the path to the real binary with |
Beta Was this translation helpful? Give feedback.
-
This gives me (again) |
Beta Was this translation helpful? Give feedback.
-
This is getting into the realm of local system configuration (and while I did not think this was a Poetry bug before, I am 99% certain it's a local issue now) -- you should be able to find out if it's a package with I'm converting this to a discussion as it's pretty clearly a support issue now -- but honestly, I you'll have to do most of the work to figure out what is going on as it's rather difficult for others to try and introspect the state of your machine over the internet. |
Beta Was this translation helpful? Give feedback.
-
I understand your reasoning although I have no idea where 3.9 came from (this is a clean Ubuntu install, not an update; any chance poetry itself did the install? but I did 3 installs before that (Chrome, PyCharm, Obsidian, might be one of those). The output of the |
Beta Was this translation helpful? Give feedback.
-
Thank you, will try (tomorrow) and report back :-) |
Beta Was this translation helpful? Give feedback.
-
Just to report... works after doing this:
Thank you for your support and hinting at the right solution. |
Beta Was this translation helpful? Give feedback.
-
For others that come across this thread, I had the same issue but with Fix for me was to run: sudo apt install python3.11-full |
Beta Was this translation helpful? Give feedback.
-
I'm facing the following error
|
Beta Was this translation helpful? Give feedback.
This is getting into the realm of local system configuration (and while I did not think this was a Poetry bug before, I am 99% certain it's a local issue now) -- you should be able to find out if it's a package with
dpkg -S /usr/bin/python3.9
. Ubuntu 22.04 does not package Python 3.9 (and an upgrade from an older version should have replaced it with 3.10). You have some Python 3.9 installed from somewhere, presumably based on Debian packaging as it ships with a broken distutils.I'm converting this to a discussion as it's pretty clearly a support issue now -- but honestly, I you'll have to do most of the work to figure out what is going on as it's rather difficult for others to try and in…