-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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][macOS] 3.10 wheel is mislabeled as universal2 #28387
Comments
According to the error details, it seems you own a Macbook with M1 chip, we currently don't have the machine to build binary wheels for them. This error is not Python version specific. On the other hand, you can try to emulate x86 architecture: arch -x86_64 /bin/bash
# Then install Python, Python packages, and run the application |
Actually, it is. I similarly am able to install I agree that you wouldn't expect this to depend on the Python version, and indeed that gives us a clue as to what the problem is. On Python 3.9, Note the "universal2", which is incorrectly claiming that the wheel supports both x86_64 and arm64 architectures. Not having an M1 mac is fine, but please adjust your build process to tag the wheel with x86_64 instead of universal2 so that M1 macs don't incorrectly download the wheel. |
Super annoying. |
Thanks for the report. We are using the same build process for macOS wheels right now. And we uses We might need some volunteer here to investigate why |
Doesn't auditwheel only work for Linux? |
Whoops, yep, I was wrong about the
|
The log suggests that pyenv picked Python 3.10.1. |
I am happy to do the investigation i will post some notes when i get started. |
@lidizheng if you could point me to the instructions to build and tag the wheel and hence investigate it on M1, i might be able to give you the information you are looking for. |
@amitsaha All Python wheels are built by this script for Linux/macOS: https://github.com/grpc/grpc/blob/master/tools/run_tests/helper_scripts/build_python.sh (Sorry for its messiness) |
Encountered the same error here with Python 3.10 on Macbook M1. |
@lidizheng could we update the CI scripts to use this new option added by |
Environment:
Ran:
I have the following wheels built now:
Now, i use them to build an example protobuf file:
Everything works. Also for additional investigation:
Build the wheels in
The created wheels are identical - no difference in tagging. I perform the same step above installing the new wheels and I can build the proto file successfully. The
So, it seems on my local system running M1 in X86_64 emulation mode, the tagging system is correct, since the I will get hold of an Intel Mac and run the above steps. |
@amitsaha Can you try to run the helloworld example from the universal wheel you built? The |
@lidizheng great idea and i see this error when using the
No such error when i build them in the native |
This issue looks relevant: pypa/wheel#406 In particular:
It seems like maybe |
Thanks. This enables me to resolve the previous error message. However, I am seeing the following error now:
Tried with both 1.43.0 and 1.41.1 version grpc, got the same above error. |
I added this to my install script after my usual pip install command:
|
just wanted to +1 @hx-markterry's steps worked perfectly for me |
If everything goes well, you should see this in |
I confirm this is solved. |
|
Any updates on the fix to support apple silicon? This is still not working for me. |
@abax1 there is no fix to support Apple Silicon AFAIK. If you're interested I made this unofficial repo with Apple Silicon builds (look in Releases) |
Had to downgrade to 1.44.0 as current version 1.54.2 does not have a wheel for Bug Sur 11.7.4 (20G1120). I'll upgrade to 11.7.7 see if it will work without building from source. |
Tried on grpc-1.55.1. This issue is still there on Mac M1 chips with Bazel build. |
@peggyxia-alj The Bazel build is not universal2 -- the artifacts labelled In general, I would not recommend using our Bazel build to produce artifacts to run anywhere but on the machine which did the build. |
Best response in all of internet related to this issue! Concise. Uses basic understanding of how pip wheels work! It's just elegant! Thank you so much! |
The following problem: on 3.9 python everything works, but when upgrading to 3.10, the following problem an import error occurs
Are there any solutions?
The text was updated successfully, but these errors were encountered: