ImportError: No module named tensorflow

前端 未结 18 2299
长情又很酷
长情又很酷 2020-11-28 05:11

Please help me with this error

I have installed the tensorflow module on my server and below is it\'s information

15IT60R19@cpusrv-gpu-109:~$ pip sho         


        
相关标签:
18条回答
  • 2020-11-28 06:10

    Activate the virtualenv environment by issuing one of the following commands:

    $ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
    $ source ~/tensorflow/bin/activate.csh # csh or tcsh

    Hope this help

    0 讨论(0)
  • 2020-11-28 06:11

    Try installing tensorflow again with the whatever version you want and with option --ignore-installed like:

    pip install tensorflow==1.2.0 --ignore-installed
    

    I solved same issue using this command.

    0 讨论(0)
  • 2020-11-28 06:11

    I had exactly the same problem. It's because default python is in version 2 You need to link to the version 3.

    >sudo rm -rf /usr/bin/python
    >sudo ln -s /usr/bin/python3.5 /usr/bin/python
    

    0 讨论(0)
  • 2020-11-28 06:13

    This Worked for me:

    $ sudo easy_install pip
    $ sudo easy_install --upgrade six
    $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl
    $ sudo pip install --upgrade $TF_BINARY_URL
    
    0 讨论(0)
  • 2020-11-28 06:15

    Instead of using the doc's command (conda create -n tensorflow pip python=2.7 # or python=3.3, etc.) which wanted to install python2.7 in the conda environment, and kept erroring out saying the module can't be found when following the installation validation steps, I used conda create -n tensorflow pip python=3 to make sure python3 was installed in the environment.

    Doing this, I only had to type python instead of python3 when validating the installation and the error went away.

    0 讨论(0)
  • 2020-11-28 06:15

    I ran into the same issue. I simply updated my command to begin with python3 instead of python and it worked perfectly.

    0 讨论(0)
提交回复
热议问题