无法在Windows,Python 3.5上导入Tensorflow

时间:2019-06-13 13:07:12

标签: python tensorflow

当我尝试在pycharm上运行import tensorflow时,出现以下错误消息:

Traceback (most recent call last):
      File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
        module = self._system_import(name, *args, **kwargs)
    ImportError: No module named 'numpy.core._multiarray_umath'
    ImportError: numpy.core.multiarray failed to import
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
        module = self._system_import(name, *args, **kwargs)
      File "<frozen importlib._bootstrap>", line 968, in _find_and_load
    SystemError: PyEval_EvalFrameEx returned a result with an error set
    2019-06-13 17:03:10.027225: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 

我尝试使用pip命令卸载并安装tensorflow,但没有帮助。

1 个答案:

答案 0 :(得分:0)

conda install -c conda-forge张量流

OR

conda create -n tensorflow pip python = 3.5

// cmd用于激活

c:>激活张量流

(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow