简体   繁体   English

无法在 Python 3.6.6 中导入 tensorflow

[英]Can't import tensorflow in Python 3.6.6

I installed tensorflow with pip3 install tensorflow and then I opened the terminal typed python and import tensorflow .我用pip3 install tensorflow然后我打开终端输入pythonimport tensorflow

But when I hit Enter it gives me an Error:但是当我按 Enter 时,它给了我一个错误:

Invalid machine command (memory dump written)

I already reinstalled tensorflow multiple times but it won't work.我已经多次重新安装 tensorflow 但它不起作用。 Could someone please help me?有人可以帮我吗?

Not sure what's causing your problem exactly but if you search for same problem and possible solutions online, you reach here: https://github.com/tensorflow/tensorflow/issues/17411 .不确定究竟是什么导致了您的问题,但如果您在线搜索相同的问题和可能的解决方案,请访问此处: https : //github.com/tensorflow/tensorflow/issues/17411

Basically a solution would be to install an earlier tensorflow version.基本上一个解决方案是安装较早的 tensorflow 版本。

Try:尝试:

pip uninstall tensorflow
pip install tensorflow==1.5
  1. install anaconda or miniconda安装 anaconda 或 miniconda
  2. create a virtualenv with conda create -n tensorflow python=3.6使用conda create -n tensorflow python=3.6创建一个 virtualenv
    2.5 activate the environement with source activate tensorflow 2.5 使用source activate tensorflow
  3. in the virtualenv (tensorflow)name@name$ type conda install tensorflow在 virtualenv (tensorflow)name@name$输入conda install tensorflow
  4. after installation type (always in the virtualenv) python3 and then import tensorflow安装后键入(始终在 virtualenv 中) python3然后import tensorflow
  5. Always launch tensorflow in the virtualenv.始终在 virtualenv 中启动 tensorflow。 To deactivate the virtualenv type exit to reactivate it type source activate tensorflow要停用 virtualenv 类型exit以重新激活它,请键入source activate tensorflow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM