Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean environment fails to run poetry install numpy pandas numba #8489

Closed
4 tasks done
migueltorrescosta opened this issue Sep 29, 2023 · 5 comments
Closed
4 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@migueltorrescosta
Copy link

  • Poetry version: 1.6.1
  • Python version: 3.10.11
  • OS version and name: macOS 13.5.1
  • pyproject.toml: Clean pyproject.toml after running poetry init. Available below if relevant
[tool.poetry]
name = "test-ppn"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10,<3.13"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Poetry is not able to simultaneously install numba, numpy and pandas. Having created a new project with poetry init, I get

❯ poetry add numba numpy pandas
Using version ^0.58.0 for numba
Using version ^1.26.0 for numpy
Using version ^2.1.1 for pandas

Updating dependencies
Resolving dependencies... (0.0s)

Because numba (0.58.0) depends on numpy (>=1.21,<1.26)
 and no versions of numba match >0.58.0,<0.59.0, numba (>=0.58.0,<0.59.0) requires numpy (>=1.21,<1.26).
So, because test-ppn depends on both numba (^0.58.0) and numpy (^1.26.0), version solving failed.

I can install the same packages using pip

❯ .venv/bin/pip install numpy pandas numba
Looking in indexes: https://pypi.org/simple
Collecting numpy
  Obtaining dependency information for numpy from https://files.pythonhosted.org/packages/5c/ff/0e1f31c70495df6a1afbe98fa237f36e6fb7c5443fcb9a53f43170e5814c/numpy-1.26.0-cp310-cp310-macosx_11_0_arm64.whl.metadata
  Using cached numpy-1.26.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (53 kB)
Collecting pandas
  Obtaining dependency information for pandas from https://files.pythonhosted.org/packages/ff/5a/c7359edec58500b35da8dc40a69ea7b0a3be48a479e1c91e8e8d0a2d9aa7/pandas-2.1.1-cp310-cp310-macosx_11_0_arm64.whl.metadata
  Using cached pandas-2.1.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (18 kB)
Collecting numba
  Obtaining dependency information for numba from https://files.pythonhosted.org/packages/1e/72/cd55b7091ce87f74dfc4c48255d4f85708486a3ccced3ecd1b3a52501c54/numba-0.58.0-cp310-cp310-macosx_11_0_arm64.whl.metadata
  Using cached numba-0.58.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (2.7 kB)
Collecting python-dateutil>=2.8.2 (from pandas)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz>=2020.1 (from pandas)
  Obtaining dependency information for pytz>=2020.1 from https://files.pythonhosted.org/packages/32/4d/aaf7eff5deb402fd9a24a1449a8119f00d74ae9c2efa79f8ef9994261fc2/pytz-2023.3.post1-py2.py3-none-any.whl.metadata
  Using cached pytz-2023.3.post1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.1 (from pandas)
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Collecting llvmlite<0.42,>=0.41.0dev0 (from numba)
  Obtaining dependency information for llvmlite<0.42,>=0.41.0dev0 from https://files.pythonhosted.org/packages/bc/f3/ff6a9242408d5f9055b80e0141db85b19f29e69ac2fe54f90b2afcf7ebca/llvmlite-0.41.0-cp310-cp310-macosx_11_0_arm64.whl.metadata
  Using cached llvmlite-0.41.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (4.8 kB)
Collecting numpy
  Obtaining dependency information for numpy from https://files.pythonhosted.org/packages/c3/ea/1d95b399078ecaa7b5d791e1fdbb3aee272077d9fd5fb499593c87dec5ea/numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl.metadata
  Using cached numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl.metadata (5.6 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached pandas-2.1.1-cp310-cp310-macosx_11_0_arm64.whl (10.9 MB)
Using cached numba-0.58.0-cp310-cp310-macosx_11_0_arm64.whl (2.6 MB)
Using cached numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl (14.0 MB)
Using cached llvmlite-0.41.0-cp310-cp310-macosx_11_0_arm64.whl (28.8 MB)
Using cached pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
Installing collected packages: pytz, tzdata, six, numpy, llvmlite, python-dateutil, numba, pandas
Successfully installed llvmlite-0.41.0 numba-0.58.0 numpy-1.25.2 pandas-2.1.1 python-dateutil-2.8.2 pytz-2023.3.post1 six-1.16.0 tzdata-2023.3
❯ .venv/bin/pip freeze
llvmlite==0.41.0
numba==0.58.0
numpy==1.25.2
pandas==2.1.1
python-dateutil==2.8.2
pytz==2023.3.post1
six==1.16.0
tzdata==2023.3

The above assures me that numba==0.58.0, numpy==1.25.2 and pandas==2.1.1 work well together, so I try the first step with the versions specified

❯ poetry add numba==0.58.0 numpy==1.25.2 pandas==2.1.1
Creating virtualenv test-ppn in /Users/mcosta/Pit/test_ppn/.venv

Updating dependencies
Resolving dependencies... (0.1s)

Because pandas (2.1.1) depends on numpy (>=1.26.0)
 and test-ppn depends on numpy (1.25.2), pandas is forbidden.
So, because test-ppn depends on pandas (2.1.1), version solving failed.

Is there a reason poetry is not able to install the same package dependencies that pip is able to install? I can see the line pandas (2.1.1) depends on numpy (>=1.26.0), however this is not enough information to solve the root problem of finding three versions that poetry agrees are compatible with each other. I use the expression "poetry agrees" because pip is okay with it.

Thank you for your help!

@migueltorrescosta migueltorrescosta added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 29, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Sep 29, 2023

poetry add without further instruction always insists on the latest version. This is covered by #707.

Here you are seeing that the latest versions of the packages you are adding are not compatible. So instead you will need to ask for not the latest versions.

Edit: I see that later you try explicitly naming versions and ask why poetry and pip disagree on whether they are compatible. That's because poetry is solving for the whole python range declared in your pyproject.toml: and the incompatibility that the error message describes exists at python 3.12.

please close.

@migueltorrescosta
Copy link
Author

migueltorrescosta commented Sep 29, 2023

the incompatibility that the error message describes exists at python 3.12.

I doubt that is the case, since I get the same error by replacing the python version in pyproject.toml ( in the section copied below ) with any of:

  • >=3.10,<3.13
  • >=3.10,<3.12
  • >=3.10,<3.11
  • 3.10,
  • 3.10.11
  • ~3.10
[tool.poetry.dependencies]
python = "~3.10"

Reducing the python version to the one pip used ( 3.10.11 ) did not suffice to solve the compatibility issues

Thank you for your prompt response above @dimbleby 🙇

@dimbleby
Copy link
Contributor

no worries, please close

@migueltorrescosta
Copy link
Author

🙇

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants