Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

“zsh: illegal hardware instruction python” when Tensorflow on macbook pro M1

I've followed every step of this question

install a venv: python3 -m venv venv. drag the install_venv.sh (which is located within the downloaded folder) file to the terminal, add -p at the end. select the directory of the venv as the location where tensorflow should be installed. activate the venv. type "python". try to import tensorflow: import tensorflow as tf.

I'm running my terminal not rosetta (which was the solution to the other problem): (base) user@useros ~ % uname -m arm64

When I activate my environment I still get: (venv) (base) user@useros ~ % uname -m arm64

If I run file $(which python) I get the following: On base: (base) user@useros ~ % file $(which python) /Users/user/opt/anaconda3/bin/python: Mach-O 64-bit executable x86_64

On venv: (venv) (base) user@useros ~ % file $(which python) /Users/user/venv/bin/python: Mach-O 64-bit executable x86_64

Why do I get 'Mach-O 64-bit executable x86_64' here even though I get 'arm64' before? This confuses me and is probably the reason why my code is not working.

question from:https://stackoverflow.com/questions/65946627/zsh-illegal-hardware-instruction-python-when-tensorflow-on-macbook-pro-m1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For Macbook pro M1, Tensorflow support is still ongoing. Please take a look at this comment.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...