-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 'cleo' #3345
Comments
Hello @TaCheJW, how have you installed or updated to the current version? What do you mean by "doesn't solve my problem" exactly? Did you uninstall poetry and tried to reinstalled afterwards? fin swimmer |
|
I encounter the same problem on Windows as well. The steps leading to this were:
After that, poetry cannot run anything, even |
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. |
On my Mac mini M1 using the EDIT: nvm it just does not work on latest 3.10 release |
I've had some success in just making a new copy of the |
Still coming up with the issue with python 3.10 and poetry 1.1.11; I'm unable to run any I tried uninstalling ( The only way I can run poetry is with previous versions of python - installed with |
@ElDifinitivo Can you explain your solution in a bit more detail? I've tried 3.10.0 using
|
@dycw can you provide the contents of |
Hi @abn, it looks pretty empty:
with
|
Looks like the issue is the followin line. #!/usr/bin/env python3 This means the script will attempt to use the whatever the current active #!/home/derek/.local/share/pypoetry/venv/bin/python podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
cat /root/.local/bin/poetry
EOF $ podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
cat /root/.local/bin/poetry
EOF
+ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
+ python -
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/root/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (1.1.11)
Installing Poetry (1.1.11): Creating environment
Installing Poetry (1.1.11): Installing Poetry
Installing Poetry (1.1.11): Creating script
Installing Poetry (1.1.11): Done
Poetry (1.1.11) is installed now. Great!
To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.
Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
+ cat /root/.local/bin/poetry
#!/root/.local/share/pypoetry/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from poetry.console import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) Looks like you might have installed poetry previously usin the Then use the following command to install a brand new instance. curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - Note you can modify |
I can't really share the Dockerfile I'm using, but it does use poetry install. I started it out trying to use Using poetry 1.1.11 |
I have the same issue using poetry 1.1.11 with Python 3.10
It seems that the poetry tarball that is installed has a vendor folder per Python version and 3.10 is not included. |
I experienced this as well when upgrading from Python 3.9.7 to 3.10.0, but not when upgrading to 3.9.8, @riconnon. |
@riconnon @Kurt-von-Laven @TaCheJW I'd suggest you remove any existing Poetry installation and then install Poetry again either via curl -sSL https://install.python-poetry.org/ | python3 - Make sure you add the relevant bin directory to your path. Closing this for now as |
@abn I did use pipx |
@dmwyatt I am unable to reproduce the issue. podman run --rm -i --entrypoint bash docker.io/python:3.10-bullseye <<EOF
set -xe
pip --quiet --disable-pip-version-check install pipx
pipx install poetry
/root/.local/bin/poetry --version
EOF output:
+ pip --quiet --disable-pip-version-check install pipx
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ pipx install poetry
⚠️ Note: '/root/.local/bin' is not on your PATH environment variable. These
apps will not be globally accessible until your PATH is updated. Run `pipx
ensurepath` to automatically add it, or manually modify your PATH in your
shell's config file (i.e. ~/.bashrc).
done! ✨ 🌟 ✨
creating virtual environment...
creating shared libraries...
upgrading shared libraries...
installing poetry...
installed package poetry 1.1.11, Python 3.10.0
These apps are now globally available
- poetry
+ /root/.local/bin/poetry --version
Poetry version 1.1.11 |
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 Apologies for the noise. |
hmm, the issue I have with this is that if I am "using Poetry version 1.1.11" then how do I install it? becuase |
@Kurt-von-Laven I suspect improvements to how the default interpretor is detected is more likely than fixes to @riconnon the installer is not really tied to a poetry release. To reflect this more accurately, the installer has been moved to https://github.com/python-poetry/install.python-poetry.org. This is maintained outside of Poetry release cycles. So, you can use the install script for installing curl -sSL https://install.python-poetry.org | python - |
@abn interesting. problem is that if I curl from some random domain (eg. install.python-poetry,org) I have no way to be sure the install script still does what I expect it to do.
Now, were I to want to do similar, I would have to do independent reviews of updates to the install script from those of updates to poetry |
Quite honestly, curling from GitHub or Poetry's official domain is not much different. Neither is signed. And if you want to use GitHub, use the raw url from the new repo. https://raw.githubusercontent.com/python-poetry/install.python-poetry.org/main/install-poetry.py You can use a specific commit ID if you want consistency. As I said before the installer is not tied to versions. And these scripts will be removed after the 1.2.0 release. Further, if you want to secure your supply chain, you really ought to have all your wheels signed for the entire dependency chain. This includes |
@abn, I may have misinterpreted, but my interpretation of #651 is that #4199 will be closed as too cumbersome to fix from a maintenance perspective as well. News to the contrary would certainly be welcome though; hopefully I am mistaken. I'm confused as to why I ought to specify the Git repository to the install script (and which Git repository I would install besides the default one). |
@Kurt-von-Laven I need to go through those in a bit more detail. But, as I understand it, the issue you are referring to is that when we do In my mind, Poetry should work as an external tool, running in it's own environment. And it should not execute itself under the active environment but rather in it's isolated environment into which it was installed. This should really go into a project discussion as it is off topic for this particular issue. As for the git repo, the command would be something like this. python install-poetry.py --git https://github.com/python-poetry/poetry.git@master This is so that you can test if #4433 fixes anything for you. As this has not been released yet. |
Thank you, @abn. Yes, uninstalling all versions of Poetry and updating the Poetry plugin to use: install_url="https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py"
curl -sSL "$install_url" | POETRY_HOME=$install_path python3 - --git "https://github.com/python-poetry/poetry.git@$version" works for me. I also specified |
@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 |
This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github.com/python-poetry/install.python-poetry.org - python-poetry/poetry#3345 (comment) In conjunction with asdf-community#14 this gets python 3.10 working with poetry 1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.
This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github.com/python-poetry/install.python-poetry.org - python-poetry/poetry#3345 (comment) In conjunction with asdf-community#14 this gets python 3.10 working with poetry 1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.
This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github.com/python-poetry/install.python-poetry.org - python-poetry/poetry#3345 (comment) In conjunction with asdf-community#14 this gets python 3.10 working with poetry 1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.
This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github.com/python-poetry/install.python-poetry.org - python-poetry/poetry#3345 (comment) In conjunction with asdf-community#14 this gets python 3.10 working with poetry 1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.
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 |
The problem remains for python 3.11.1. |
This issue only tracks installs with the old installer, which used a bespoke packaging format. This issue is no longer relevant as the installer has been replaced. If you are experiencing something similar, it likely is purely a local issue; try reinstalling using the recommended methods. If that doesn't solve it, you need to create a reproducer so that others can reason about your issue and help you. If you can reproduce it in a container or brand new VM, please open an issue with detailed instructions. |
Nice approach! I solved my problem with this too. I should change |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Issue
I cannot run even poetry --version now.
#3071 doesn't solve my problem
The text was updated successfully, but these errors were encountered: