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

Python 3.10 macOS wheel is tagged as universal2 but only supports x64 (install error on M1 Mac: "incompatible architecture (have 'x86_64', need 'arm64e')") #167

Closed
programatt opened this issue Jan 28, 2022 · 4 comments
Labels

Comments

@programatt
Copy link

I have installed libraw with brew install libraw and rawpy with pip install rawpy. However I receive the following error when trying to import rawpy in my code

% python3
Python 3.10.1 (main, Dec  6 2021, 22:18:13) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import rawpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/matt/code/venvs/tc/lib/python3.10/site-packages/rawpy/__init__.py", line 5, in <module>
    import rawpy._rawpy
ImportError: dlopen(/Users/matt/code/venvs/tc/lib/python3.10/site-packages/rawpy/_rawpy.cpython-310-darwin.so, 0x0002): tried: '/Users/matt/code/venvs/tc/lib/python3.10/site-packages/rawpy/_rawpy.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_rawpy.cpython-310-darwin.so' (no such file), '/usr/lib/_rawpy.cpython-310-darwin.so' (no such file)

I don't really understand how python packaging and wheels work but my understanding is the --no-binary :all: option should try and build the package from source but I got this error.

pip install rawpy --no-binary :all:
ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none)
ERROR: No matching distribution found for rawpy

Does rawpy support running on arm64 systems?

@letmaik
Copy link
Owner

letmaik commented Jan 28, 2022

rawpy doesn't publish arm64 wheels yet (because GitHub Actions doesn't have M1 runners yet), but for some reason the x64 wheel for Python 3.10 is tagged as universal2 which it shouldn't be. This is why it successfully installs for you but then fails during import.
You can build from source by following https://github.com/letmaik/rawpy#installation-from-source-on-linuxmacos. Note that arm64 hasn't been tested, so you're on your own here.
I'll leave this issue open to deal with the mistagged 3.10 wheel.

@letmaik letmaik changed the title Rawpy pip package wrong architecture on M1 Mac (arm64) Python 3.10 macOS wheel is tagged as universal2 but only supports x64 (install error on M1 Mac: "incompatible architecture (have 'x86_64', need 'arm64e')") Jan 28, 2022
@letmaik letmaik added the bug label Jan 28, 2022
@programatt
Copy link
Author

@letmaik thanks, I was able to get it to install from source and it imports ok. I will try using it now. Do you want me to report any issues with arm64 that I run into on a different issue or this one?

@letmaik
Copy link
Owner

letmaik commented Jan 28, 2022

For arm64 issues, please open new issues please.

Regarding the tagging issue, seems like this is known: pypa/setuptools#2520 (reference)

@kamikaze
Copy link

u don't need to wait for arm64 runners, use docker buildx actions, take a look: https://github.com/kamikaze/fastapi-auth-service/tree/master/.github/workflows

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

3 participants