无法在Python 3.6.6中导入Tensorflow

时间:2018-10-02 14:41:37

标签: python python-3.x tensorflow pip

我用pip3 install tensorflow安装了tensorflow,然后打开了pythonimport tensorflow终端,
但是,当我按下Enter时,出现一个错误:Invalid machine command (memory dump written)我已经多次重新安装了tensorflow,但无法正常工作。有人可以帮我吗?谢谢:D

2 个答案:

答案 0 :(得分:2)

不确定是什么引起了您的问题,但是如果您在线搜索相同的问题和可能的解决方案,则可以访问https://github.com/tensorflow/tensorflow/issues/17411

基本上,解决方案是安装早期的tensorflow版本。

尝试:

pip uninstall tensorflow
pip install tensorflow==1.5

答案 1 :(得分:0)

  1. 安装anaconda或miniconda
  2. 使用conda create -n tensorflow python=3.6创建一个virtualenv
    2.5使用source activate tensorflow
  3. 激活环境
  4. 在virtualenv (tensorflow)name@name$中,键入conda install tensorflow
  5. 安装类型后(始终在virtualenv中)依次为python3import tensorflow
  6. 始终在virtualenv中启动tensorflow。要停用virtualenv,请输入exit 要重新激活它,请输入source activate tensorflow