Tensorflow import error: No module named 'tensorflow'

后端 未结 9 1794
走了就别回头了
走了就别回头了 2020-12-24 14:47

I installed TensorFlow on my Windows Python 3.5 Anaconda environment The validation was successful (with a warning)

(tensorflow) C:\\>python
9条回答
  •  难免孤独
    2020-12-24 15:40

    The reason why Python base environment is unable to import Tensorflow is that Anaconda does not store the tensorflow package in the base environment.

    create a new separate environment in Anaconda dedicated to TensorFlow as follows:

    conda create -n newenvt anaconda python=python_version
    

    replace python_version by your python version

    activate the new environment as follows:

    activate newenvt
    

    Then install tensorflow into the new environment (newenvt) as follows:

    conda install tensorflow
    

    Now you can check it by issuing the following python code and it will work fine.

    import tensorflow
    

提交回复
热议问题