Poetry stuck in infinite install/update
Question:
My issue is that when I execute poetry install
, poetry update
or poetry lock
the process keeps running indefinitely.
I tried using the -vvv
flag to get output of what’s happening and it looks like it gets stuck forever in the first install.
My connection is good and all packages that I tried installing exist.
I use version 1.2.1 but I cannot upgrade to newer versions because the format of the .lock
file is different and our pipeline fails.
Answers:
I found a clue in an issue on the GitHub repo.
If you are using Linux you must delete all .lock
files in the .cache/pypoetry
dir in your user home directory.
find ~/.cache/pypoetry -name '*.lock' -type f -delete
If the directory does not exist maybe is in another location.
Then I recommend removing the generated .lock
file in the project you were doing the installation.
Another possibility is a corrupted artifact cache. (Source)
You can remove all the virtual environments, clear the cache, and delete the contents of the poetry artifacts
directory using the following:
poetry env remove --all
poetry cache clear --all .
rm -rf $(poetry config cache-dir)/artifacts
Additionally, you could also delete the poetry.lock
file and try poetry install
again.
My issue is that when I execute poetry install
, poetry update
or poetry lock
the process keeps running indefinitely.
I tried using the -vvv
flag to get output of what’s happening and it looks like it gets stuck forever in the first install.
My connection is good and all packages that I tried installing exist.
I use version 1.2.1 but I cannot upgrade to newer versions because the format of the .lock
file is different and our pipeline fails.
I found a clue in an issue on the GitHub repo.
If you are using Linux you must delete all .lock
files in the .cache/pypoetry
dir in your user home directory.
find ~/.cache/pypoetry -name '*.lock' -type f -delete
If the directory does not exist maybe is in another location.
Then I recommend removing the generated .lock
file in the project you were doing the installation.
Another possibility is a corrupted artifact cache. (Source)
You can remove all the virtual environments, clear the cache, and delete the contents of the poetry artifacts
directory using the following:
poetry env remove --all
poetry cache clear --all .
rm -rf $(poetry config cache-dir)/artifacts
Additionally, you could also delete the poetry.lock
file and try poetry install
again.