Poetry very slow with some packages since 1.2
See original GitHub issueHello,
Since updating to Poetry 1.2.X dependency resolution is very slow for some packages. (After uninstalling 1.2.2 and installing 1.1.15 everything is working fine).
I’ve tried clearing caches. It seems to always block at Creating new session for files.pythonhosted.org.
Exemple with numpy: (using poetry run pip install numpy works fine)
$ poetry init
$ poetry add numpy -vvv
Loading configuration file /Users/jc/Library/Preferences/pypoetry/config.toml
Using virtualenv: /Users/jc/projects/lifen/git/tmp/test-poetry1.2/.venv
Project environment contains an empty path in sys_path, ignoring.
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
Creating new session for pypi.org
[urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443
[urllib3.connectionpool] https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 304 0
Source (PyPI): 90 packages found for numpy *
Using version ^1.23.4 for numpy
Updating dependencies
Resolving dependencies...
1: fact: test-poetry1-2 is 0.1.0
1: derived: test-poetry1-2
1: fact: test-poetry1-2 depends on numpy (^1.23.4)
1: selecting test-poetry1-2 (0.1.0)
1: derived: numpy (>=1.23.4,<2.0.0)
Source (PyPI): 1 packages found for numpy >=1.23.4,<2.0.0
Source (PyPI): The cache for numpy 1.23.4 is outdated. Refreshing.
Source (PyPI): Getting info for numpy (1.23.4) from PyPI
Source (PyPI): No dependencies found, downloading archives
Source (PyPI): Downloading sdist: numpy-1.23.4.tar.gz
Creating new session for files.pythonhosted.org
→ hangs for a very long time
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Poetry is extremely slow when resolving the dependencies
If you are having issues with Poetry taking a long time to resolve dependencies, please first open a Discussion or start on Discord,...
Read more >FAQ | Documentation | Poetry - Python dependency ...
FAQ Why is the dependency resolution process slow? While the dependency resolver at the heart of Poetry is highly optimized and should be...
Read more >Should You Use Upper Bound Version Constraints?
To be clear, Poetry doesn't force version pinning on you, but it does push you really, really hard to always version cap, and...
Read more >Ask HN: Why Poetry did not become a mainstream package ...
If I install something with pip, the newly installed package goes into some mysterious directory whose location is never quite certain.
Read more >Poetry for ML on Cluster - Ziyi Xi (席子义)
So, in summary, I prefer some virtual environment managers with details dependency descriptions. A better package manager, Poetry. I am using ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

mostly this symptom is because of a stray
.lockfile in your cache and will be resolved byfind ~/.cache/pypoetry/ -name '*.lock' -deleteor equivalent if your cache is somewhere else.this is fixed in 1.3
I confirm that Poetry 1.2.2 sometimes may hang forever for
poetry lockon Python 3.10.6.I was waiting for a few hours. Then I enabled verbosity and I saw that Poetry hangs right after
Creating new session for(GitLab in my case). Poetry gets 200 response status code and hangs forever. Nothing happens further.The solution is to run
sudo rm -r ~/.cache/pypoetry