Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Can't install universal2 version of numpy #21233

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

Closed
w3sip opened this issue Mar 23, 2022 · 7 comments
Closed

BUG: Can't install universal2 version of numpy #21233

w3sip opened this issue Mar 23, 2022 · 7 comments
Labels

Comments

@w3sip
Copy link

w3sip commented Mar 23, 2022

Describe the issue:

Release notes document MD5 checksums for universal2 wheels. However, I can't seem to find one.

Any attempt to python3 -m pip install numpy --target foo --platform=universal2 results in building from source (asks to add --no-deps), which subsequently fails.

What would be the best way to install universal2 (e.g. arm64+x86_64) distribution of numpy?

Reproduce the code example:

n/a

Error message:

: error: no such file or directory: 'build/temp.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/dragon4.o'

Full error: https://gist.github.com/w3sip/a99d0febfd44e7e991b6d32117ba3291

NumPy/Python version information:

$ python3.9 --version
Python 3.9.11
$ which python3.9
/usr/local/bin/python3.9
$ ls -la /usr/local/bin/python3.9
lrwxr-xr-x  1 root  wheel  71 Mar 16  2021 /usr/local/bin/python3.9 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
@w3sip w3sip added the 00 - Bug label Mar 23, 2022
@charris
Copy link
Member

charris commented Mar 23, 2022

There are no universal2 wheels for NumPy 1.22+, 1.21 was the last version that had them. However there are wheels for both x86_64 and arm separately. Just install using the python you intend to use if you want the latest version. python3 -m pip install numpy should do it.

@w3sip
Copy link
Author

w3sip commented Mar 23, 2022

@charris - I guess I need to elaborate. Our product embeds a Python installation with numpy included. M1 flavor is being cross-compiled from an x86_64 CI node.
Python is being built as a fat binary, however fat binary is not a requirement. E.g. it would be possible to generate two distinct packages, one with ARM version of numpy, and one with x86_64 version. However, I would prefer to not deploy and M1 CI node to accomplish that. And I'm not seeing a way to deploy an arm64 version of numpy on an x86_64 machine (pip3.9 install numpy==1.22.3 --target foo2/ --platform=arm64 --no-deps fails with the exact same error as above on Intel Mac)

@charris
Copy link
Member

charris commented Mar 23, 2022

See #20787 for discussion of that topic.

@w3sip
Copy link
Author

w3sip commented Mar 23, 2022

I went through #20787 and while it's related, I don't think there's a conclusive answer to question: how to generate an M1 python+numpy package, when cross-compiling from x86_64.

I guess if we step back from the "universal2" flavor of question, it'd be how to deploy an arm64 wheel into a universal Python install structure, when running on x86_64?

@rgommers
Copy link
Member

This seems more a question for Pip or for Stack Overflow. We have the correct wheels on PyPI, but off the top of my head I don't know if or how it's possible to force Pip (or pypa/installer or Poetry or ...) to do this. NumPy isn't special in this regard.

@mattip
Copy link
Member

mattip commented Nov 19, 2022

This is an almost duplicate of #18143. I think the discussion there covers the questions here, and will close this. Please reopen if I missed the point.

@mattip mattip closed this as completed Nov 19, 2022
@rgommers
Copy link
Member

To summarize the main point, here is how to create a universal2 wheel from separate thin wheels, if you so desire:

pip install delocate
delocate-fuse $amd64_wheel $arm64_wheel -w .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants