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 install extremely slow when installing scipy

See original GitHub issue
  • 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: Arch Linux & Docker environment python:latest (currently python-3.10 with debian bullseye)

  • Poetry version: 1.1.12

  • **Link of a Gist **

Issue

Installation of scipy takes a very long time (>5 min) when running

poetry install

The Gist above is a reduced version where the long installation occurs because scipy is a dependency for spatialmath-python. I ran with -vvv at the beginning and it is shown again that Python 3.10 is used. When coming to scipy it say

1: fact: scipy (1.7.3) requires Python >=3.7,❤️.11 1: derived: not scipy (==1.7.3) 1: fact: scipy (1.7.2) requires Python >=3.7,❤️.11 1: derived: not scipy (==1.7.2) 1: fact: scipy (1.7.1) requires Python >=3.7,❤️.10 1: derived: not scipy (==1.7.1) 1: fact: scipy (1.7.0) requires Python >=3.7,❤️.10 1: derived: not scipy (==1.7.0) 1: fact: scipy (1.6.3) requires Python >=3.7,❤️.10 1: derived: not scipy (==1.6.3) 1: fact: scipy (1.6.2) requires Python >=3.7,❤️.10 1: derived: not scipy (==1.6.2) 1: fact: scipy (1.6.1) depends on numpy (>=1.16.5) 1: selecting scipy (1.6.1)

which I don’t understand, since Python 3.10 is used.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
weetstercommented, Mar 11, 2022

I had a very similar problem. My project’s dependencies were python = "^3.10" and statsmodels = "0.13.1", which resulted in Poetry deciding to pull in scipy@1.6.1 for whatever reason (which does not have pre-built wheels for Python 3.10). I explicitly did poetry add scipy@1.8.0, which resulted in SolveFailure:

The current project's Python requirement (>=3.10,<4.0) is not compatible with some of the required packages Python requirement:
  - scipy requires Python >=3.8,<3.11, so it will not be satisfied for Python >=3.11,<4.0

This makes sense, because python = "^3.10" does not guarantee scipy’s requirement for ❤️.11. I changed my Python dependency to python = "3.10" (explicitly == 3.10, not >= 3.10), which allowed scipy@1.8.0 to be added. Then I tried a fresh poetry install, which finished in a matter of seconds because the pre-built scipy@1.8.0 wheel is now being used.

I think the root cause of all this (at least in my case) is the fact that Poetry originally chose scipy@1.6.1 to satisfy statsmodels@0.13.1 (which required building scipy from source) instead of a later version that has a pre-built wheel available.

1reaction
clintonroycommented, Jan 6, 2022

err, wheels 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Commands | master | Documentation | Poetry - Python ...
The install command reads the pyproject.toml file from the current project, resolves the dependencies, and installs them. poetry install. If there is a ......
Read more >
Introduction | 1.2 | Documentation | Poetry - Python ...
Introduction Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on...
Read more >
Repositories | Documentation | Poetry - Python dependency ...
By default, Poetry is configured to use the PyPI repository, for package installation and publishing. So, when you add dependencies to your project, ......
Read more >
Announcing Poetry 1.2.0rc2 | Blog
The Poetry team is pleased to announce the immediate availability of Poetry 1.2.0rc2. If you have a previous version of Poetry installed via...
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