-
Notifications
You must be signed in to change notification settings - Fork 308
M1 wrong architecture after install script #21
Comments
Could you paste your result for |
I have exactly the same situation, in the MacBook m1 virtual python environment when import tensorflow it occurs that error, don't know what to do... |
@Willian-Zhang could you give us some advice please? |
@fzzfbyx Please paste your result for |
The output:
Possible workaround, worked for me in vscode and terminal:
Switching to this environment in terminal I was able to import tensorflow mac and selecting this as the interpreter in vscode I was able to do the same where as before it was giving me the errors. |
@tomjefferis if you are having trouble running in vscode, please consider checking out beta version of it: It might also be possible work out via to setup vscode integrated terminal to use external terminal. |
@Willian-Zhang Its working in vscode but not in pycharm |
thank you for replying. But in the first time I already do that. create a new env, run the script, in the env I can find the package but can't import. what else did you do to solve this problem? |
To clarify what is happening here for others encountering this issue. There are two cpu subtypes for binary files on the M1, arm64 and arm64e. Trying to mix the two results in the error you see. For this pre-release version, we're focusing support on the arm64 version of python in the Xcode Command Line Tools, and the included wheel does not include an arm64e slice. To make sure you have the correct version of python run file $(which python) and it should display an arm64 slice, not an arm64e slice. If you encounter this problem, install the Python version from Xcode Command Line Tools, then pass the path to that version into the install script using --python=/Library/Developer/CommandLineTools/usr/bin/python3. |
Hi @hoytak, This is my first MacBook and I'm very confused about how to solve this issue, I got I have Xcode installed, Could you please elaborate a bit more the way to solve it? Thanks |
@hoytak, I agree with @chinitaberrio here. I'm not sure how I can change the python version so it is arm64e. I am also very new to MacBook and the instructions are not very clear. I installed using homebrew because I don't know how to install using command-line tools. What do I type in and where? I cannot find any advice anywhere else. |
I got this issue fixed in my repo https://github.com/chinitaberrio/tensorflow_macos Then in a terminal paste |
Thank you so much! I really appreciate this! |
I'm having a very similar problem trying to run matplotlib inside a virtual environment. I hope this isn't the wrong place to ask about it. Here's the errror I get if I try to use matplotlib in ipython: ImportError: dlopen(/Users/michaelbeavitt/.local/share/virtualenvs/michaelbeavitt-n2nhR21r/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so, 2): no suitable image found. Did find: here's the results of the which command: (michaelbeavitt) michaelbeavitt@Michaels-MacBook-Air ~ % file $(which python) Any ideas? |
@mbeavitt I think the problem is with Pillow instead. I had a problem installing matplotlib but I fixed it by doing |
Thanks for your advice! Unfortunately that didn't seem to change anything. Here is the full read-out when I try to use matplotlib in the python shell:
|
@mbeavitt Have you tried uninstalling pillow and matplotlib? S. |
There are a lot of Python related libraries that I can't use on the new M1 Mac. Can't use pygame module, managed to install pygame==1.9.6 but when I run the scripts with pygame imported I get the good old
Same goes for pyais library, and many others. |
I'm having a similar issue, but with matplotlib. I looked at previous threads about the issue, but nothing solved the problem completely. When I run a program that involves matplotlib, this is my error message: |
I'm having a similar issue, but with pydantic.
|
Im getting an error in my terminal when trying to run.
heres my trace:
/Users/tomjefferis/tensorflow_macos_venv/bin/python /Users/tomjefferis/PycharmProjects/pythonProject/test.py
Traceback (most recent call last):
File "/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): no suitable image found. Did find:
/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/tomjefferis/PycharmProjects/pythonProject/test.py", line 2, in
from tensorflow.python.compiler.mlcompute import mlcompute
File "/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/init.py", line 41, in
from tensorflow.python.tools import module_util as _module_util
File "/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/init.py", line 39, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): no suitable image found. Did find:
/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
/Users/tomjefferis/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: