poetry: pip installs numpy but poetry does not
-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate - I think it’s here (https://github.com/python-poetry/poetry/issues/1516, or here https://github.com/python-poetry/poetry/issues/3153 - but i’ve done the work arounds ([“setuptools”, “poetry_core>=1.0”]) and nothing)
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: Latest Big Sur - 11.2.3
-
Poetry version: Poetry version 1.1.4
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/aronchick/65c366b27ccc7f14caa382f19841e6ab
Issue
Hi – I’ve seen a bunch of other issues related to numpy, and know it’s a numpy problem on Big Sur EXCEPT i think i’ve done everything right (in re upgrading), and I still get the following - works when I install numpy directly via pip, but fails from poetry. What should I do here?
pip install numpy
Collecting numpy
Downloading numpy-1.20.2-cp38-cp38-macosx_10_9_x86_64.whl (16.0 MB)
|████████████████████████████████| 16.0 MB 1.1 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.20.2
poetry add numpy
Using version ^1.20.2 for numpy
Updating dependencies
Resolving dependencies... (0.2s)
Package operations: 1 install, 0 updates, 0 removals
• Installing numpy (1.20.2): Failed
EnvCommandError
[...]
-> /private/var/folders/f_/6hhd4mmx7z734psc7n4m7ygc0000gn/T/pip-req-build-7cbwqfze/build/temp.macosx-11-x86_64-3.9/ccompiler_opt_cache_clib.py
----------------------------------------
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
at /usr/local/lib/python3.9/site-packages/poetry/utils/env.py:1074 in _run
1070│ output = subprocess.check_output(
1071│ cmd, stderr=subprocess.STDOUT, **kwargs
1072│ )
1073│ except CalledProcessError as e:
→ 1074│ raise EnvCommandError(e, input=input_)
1075│
1076│ return decode(output)
1077│
1078│ def execute(self, bin, *args, **kwargs):
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 11
- Comments: 15 (2 by maintainers)
I changed the python version in my pyproject.toml and it worked for me (MacOS Big Sur + Poetry version 1.1.12 + python 3.9.9):
Is there any update to this? I’m currently able to install numpy using pip (v21.3) but not poetry. I think this might be a pip version issue, as poetry is using 21.2.4, and stackoverflow seems to have some answers indicating that general
numpy
installation issues were resolved with a newer pip version.I ran into the same issue on Windows 10 with
python=3.10
. The solution was to usepip
to install the packages and then add them withpoetry
, which just added them topyproject.toml
, therefore:I’m on 1.1.12 and I run into this too.
this worked for me on MacOs M1 as well
I ran into the same issue on OSX. For me the solution was that I needed to build the BLAS and LAPACK libraries using Brew and then link them back to the Poetry build environment as explained in this Stackoverflow question: https://stackoverflow.com/a/70880741/1216837
@clintonroy But does it? In fact, I had to resolve for all those constraints myself with those markers, which was straight forward just using pip in the venvs, and therefore should be very doable for an automated tool. And that’s exactly what I was expecting poetry would do for me. Instead it just tells me my constraints were unresolvable, which is just not true.