非法指令:在python 3.6中导入tensorflow时出现4
我使用Virtualenv在macOS上安装了 Tensorflow .一切正常(一旦我运行命令pip3 install --upgrade tensorflow
,成功安装6-1.11.0 tensorflow-1.6.0"是终端的最后输出).因此,在激活virtualenv的情况下,我键入:python3
然后是import tensorflow as tf
但它会输出错误Illegal instruction: 4
并退出python.
I installed Tensorflow on macOS with Virtualenv. Everything went okay ("Successfully installed six-1.11.0 tensorflow-1.6.0" is the last output of the terminal, once i run the command pip3 install --upgrade tensorflow
). So, with the virtualenv activated, I typed: python3
and then import tensorflow as tf
but it outputs the error Illegal instruction: 4
and quits python.
我环顾四周,看看是否有人遇到过相同的问题,但是除了这篇回答解释了非法指令的含义,关键是我使用的是最新版本的macOS High Sierra:
I looked around to see if anybody else had encountered the same issue, but I didn't find much, apart from this question, which doesn't provide a solution. I read this answer explaining what Illegal instruction means, the point is that I'm on the latest version of macOS High Sierra:
我误解了答案是什么意思?
Am I misunderstanding what the answer is referring to?
您知道我该如何解决这个问题?或希望有一种解决方法,以便我可以开始使用tensorflow.
Do you know how I could solve this issue? Or hopefully a workaround, so that I can start using tensorflow.
谢谢.
我遇到了同样的问题,所以我所做的是卸载了tensorflow 1.6.已安装
I had the same issue, so what I did was uninstalled tensorflow 1.6. installed
pip install -Iv tensorflow==1.5
pip install -Iv numpy==1.13
现在看起来还好,我猜是tensorflow 1.6中存在最新错误.
seems to be fine now, my guess is there was the latest bug in tensorflow 1.6.
要确保它与大熊猫兼容,可以执行以下操作: pip install -Iv numpy == 1.13.3
To make sure it's compatible with the pandas, you can do: pip install -Iv numpy==1.13.3