poetry: Poetry install is stuck on specific dependency with "pending..."
- 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: 10.15.7
- Poetry version: 1.1.4, 1.1.3, 1.0.9
Issue
Hello poetry crew. Loving the work that yall do!
I am having issues with poetry while running poetry install
in one of my projects on one specific machine.
It appears to get stuck on one dependency during the install and it will hang forever. When I kill the process, I see this in my shell (hinting at a race condtion/locking problem):
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/Users/{}/.pyenv/versions/3.6.8/lib/python3.6/concurrent/futures/thread.py", line 40, in _python_exit
t.join()
File "/Users/{}/.pyenv/versions/3.6.8/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
File "/Users/{}/.pyenv/versions/3.6.8/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt
I am on the latest poetry (1.1.4) and have tried 1.1.3 as well with the same results (all of which while running python 3.6.8 (I did use 3.6.5 as well)).
After downgrade to 1.0.9, I no longer faced this issue. I am assuming that there was an update to the way poetry can download multiple deps at the same time. Anyone else facing locking issues? At the very least, poetry should recognize a pending download with no progress being made to exit and fail early, but it simply hung and would never exit (left it going for at least 30 mins).
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 35 (11 by maintainers)
I do not know how to help you all here…
My advice would be to try one of those (maybe in that order) if you have not yet:
poetry.lock
file and retrypoetry config experimental.new-installer false
and retry (do not forget to reactivate it afterwards if it proves to have no influence)Also maybe provide some verbose output (
-vvv
), that might be helpful for when one of the maintainers gets the time to handle this ticket. Of course, the best as always is if you can provide a minimal reproducible example that triggers the failure.The artifacts and cache dirs were in
~/Library/Caches/pypoetry
on my M1 Mac for those who can’t find it in~/.cache/pypoetry/cache/
Doing that cleared things up for me. Before that, it was consistently hanging on trying to fetch
flake8-bugbear
from pypyit also happens under:
traceback:
workaround:
it started to happen this week, last week the same command(s) worked fine 🤔
@Purg thank you sire! i’ve been stuck on this for hours… i tried all these:
turn off the
experimental.new-installer
but this only worked “for a moment” then stopped working:
delete virtualenv - didn’t work
delete
poetry.lock
- didn’t workclear all cache by running (see https://github.com/python-poetry/poetry/issues/2094#issuecomment-1231501255)
didn’t work
only yours worked:
Happens on WSL2 ubuntu 20.04 with python3.10
I do experience the same problem with poetry 1.1.4 within a python 3.9 docker container. The error goes away by following the suggestion of @sinoroc to deactivate the experimental installer.
pyproject.toml:
poetry.lock.txt
On Ubuntu 20.04 WSL2 here. Only disabling IPv6 did the trick:
Artifacts are distfiles (wheels, sdists) and can be corrupted by an interrupted Poetry (ctrl-c, machine shutdown) as well as a concurrent Poetry. This will be fixed in the 1.3 release.
You can always find the cache directory with
poetry config cache-dir
. If you’re having issues you think might be related, try clearing the cache first. If you’re still having issues, I’d suggest opening a Discussion or joining Discord first as 90% of the time these are local config issues.I would ask that if you don’t have anything to add that hasn’t already been said in this issue, you hold off, as generating notifications for 20+ people for a root cause that is solved is unnecessary (and if you have something novel, we want to identify that and make sure it’s tracked as a new issue).
Disabling experimental installer also fixes this for me, but also able to fix it using the experimental installer by adding a timeout for the requests to pypi, E.g.
Could someone on the Poetry team provide a perspective on prioritization for this? It seems like there’s meaningful evidence that this is an issue independent of environment or dependencies. Turning off the installer is a good workaround in the interim, but it significantly increases install times. I’d love to know I have some hope of being able to turn it back on at some point.
I’m facing this issue in the latest Poetry version. This helps:
If you can reproduce this reliably in a container or clean environment, please open a new issue with the reproduction. There are many possible factors from cache corruption, network issues, etc that could influence this, so a clean reproduction is key.
I can confirm that disabling the experimental parallel installer worked. My environment, although, was Docker, particularly the python:3.8-slim image.
Same issue here. I just upgrade from v1.0.0, but got pending on some packages during installing , typically numpy , sklearn… The error message shows it got a read time out from my nexus repo, but it never happened before. And after I try the poetry install several times, it installed all package successfully. Does the parallel installation trigger this issue?