poetry: ModuleNotFoundError: No module named 'cleo'
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: windows7
- Poetry version: 1.1.4
- Python version: 3.7.8
Issue
I cannot run even poetry --version now.
Traceback (most recent call last): File “C:\Users\Administrator.poetry\bin\poetry”, line 12, in <module> from poetry.console import main File “C:\Users\Administrator.poetry\lib\poetry\console_init_.py”, line 1, in <module> from .application import Application File “C:\Users\Administrator.poetry\lib\poetry\console\application.py”, line 3, in <module> from cleo import Application as BaseApplication ModuleNotFoundError: No module named ‘cleo’
#3071 doesn’t solve my problem
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 33 (11 by maintainers)
Commits related to this issue
- install-poetry.py: Use new official install location This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github... — committed to tony/asdf-poetry by tony 3 years ago
- install-poetry.py: Use new official install location This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github... — committed to tony/asdf-poetry by tony 3 years ago
- install-poetry.py: Use new official install location This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github... — committed to tony/asdf-poetry by tony 3 years ago
- install-poetry.py: Use new official install location This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github... — committed to tony/asdf-poetry by tony 3 years ago
I’m still hitting this issue and none of the workarounds solve it.
@tedivm Did you manage to resolve the issue? I was having trouble with the same error as well, but finally I realized that my bash was using an old install of Poetry via
/home/<username>/.poetry/bin/poetry
instead of the new install method’s/home/<username>/.local/bin/poetry
. I managed to fix my problems by manually deleting/home/<username>/.poetry
, runningcurl -sSL https://install.python-poetry.org | python3 -
and then refreshing the current shell!I’ve had some success in just making a new copy of the
~/.poetry/lib/poetry/_vendor/py3.9
and renaming it to~/.poetry/lib/poetry/_vendor/py3.10
. Then I was able to get things working with a 3.10 installation (should work on windows as well). It’s not great, but might be an acceptable hack until poetry updates to be compatible with 3.10.Nice approach! I solved my problem with this too. I should change
.zshrc
to export new path!@Kurt-von-Laven glad it is resolved. Just an FYI, the install script in the poetry repo will eventually be removed and served via install.python-poetry.org. The source for it is available at https://github.com/python-poetry/install.python-poetry.org
Oops, I confused this issue for another issue I’m having in another environment that does use pipx where I keep having to delete the
artifacts
folder. You are correct that I’m only having this issue whereget-poetry
is being used.Apologies for the noise.
@riconnon @Kurt-von-Laven @TaCheJW I’d suggest you remove any existing Poetry installation and then install Poetry again either via
pipx
or via the installer (as follows).Make sure you add the relevant bin directory to your path.
Closing this for now as
get-poetry.py
is deprecated and the “platform” artifacts are problematic in general.Looks like the issue is the followin line.
This means the script will attempt to use the whatever the current active
python3
setup us. So, if this is not the same as the one in which you installed poetry into, the required dependencies might not be available. If installed viainstall-poetry.py
you should get something like this.Looks like you might have installed poetry previously usin the
get-poetry.py
script. I would recommend you uninstall first using that or manually removing~/.poetry
and the entry point script.Then use the following command to install a brand new instance.
Note you can modify
python
topython3
or to a specific executable as you desire.I had the same problem after updating to python 3.9 but the issue went away after “pip install --user poetry”. Note that I use python through pyenv.