On Windows, running “import tensorflow” generates No module named “_pywrap_tensorflow” error

后端 未结 23 3841
误落风尘
误落风尘 2020-11-22 06:55

On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow statement:

  • No module named \"_pyw
23条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 07:06

    For the people finding this post in 2019, this error could also occur because the Python version 3.7 does not have support for TensorFlow (see https://www.tensorflow.org/install/pip). So, check the Python version:

    python --version
    

    In case it is larger than 3.6, it should be downgraded to 3.6. For Anaconda:

    conda install python=3.6
    

    Then, install TensorFlow.

    pip install tensorflow
    

    Btw, I did not have the GPU version, so there were no CUDA related issues in my case.

提交回复
热议问题