question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry very slow with some packages since 1.2

See original GitHub issue

Hello,

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:closed
  • Created a year ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
dimblebycommented, Nov 1, 2022

mostly this symptom is because of a stray .lock file in your cache and will be resolved by find ~/.cache/pypoetry/ -name '*.lock' -delete or equivalent if your cache is somewhere else.

this is fixed in 1.3

5reactions
AIGeneratedUsernamecommented, Nov 20, 2022

I confirm that Poetry 1.2.2 sometimes may hang forever for poetry lock on 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found