TensorFlow not found using pip

后端 未结 30 2492
有刺的猬
有刺的猬 2020-11-22 08:06

I\'m trying to intstall TensorFlow using pip:

$ pip install tensorflow --user
Collecting tensorflow
Could not find          


        
相关标签:
30条回答
  • 2020-11-22 08:19

    Try this, it should work:

     python.exe -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
    
    0 讨论(0)
  • 2020-11-22 08:19

    update 2019: for install the preview version of TensorFlow 2 in Google Colab you can use:

    !wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 -O cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
    !dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
    !apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
    !apt-get update
    !apt-get install cuda
    !pip install tf-nightly-gpu-2.0-preview
    

    and for install the TensorFlow 2 bye pip you can use: pip install tf-nightly-gpu-2.0-preview for GPU and pip install tf-nightly-2.0-preview for CPU.

    0 讨论(0)
  • 2020-11-22 08:20

    I had the same error when trying to install on my Mac (using Python 2.7). A similar solution to the one I'm giving here also seemed to work for Python 3 on Windows 8.1 according to a different answer on this page by Yash Kumar Verma

    Solution

    Step 1: go to The URL of the TensorFlow Python package section of the TensorFlow installation page and copy the URL of the relevant link for your Python installation.

    Step 2: open a terminal/command prompt and run the following command:
    pip install --upgrade [paste copied url link here]

    So for me it was the following:
    pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.2.0-py2-none-any.whl

    Update (July 21 2017): I tried this with some others who were running on Windows machines with Python 3.6 and they had to change the line in Step 2 to: python -m pip install [paste copied url link here]

    Update (26 July 2018): For Python 3.6.2 (not 3.7 because it's in 3.6.2 in TF Documentation), you can also use pip3 install --upgrade [paste copied URL here] in Step 2.

    0 讨论(0)
  • 2020-11-22 08:23

    If you are trying to install it on a windows machine you need to have a 64-bit version of python 3.5. This is the only way to actually install it. From the website:

    TensorFlow supports only 64-bit Python 3.5 on Windows. We have tested the pip packages with the following distributions of Python:

    Python 3.5 from Anaconda

    Python 3.5 from python.org.

    You can download the proper version of python from here (make sure you grab one of the ones that says "Windows x86-64")

    You should now be able to install with pip install tensorflow or python -m pip install tensorflow (make sure that you are using the right pip, from python3, if you have both python2 and python3 installed)

    Remember to install Anaconda 3-5.2.0 as the latest version which is 3-5.3.0 have python version 3.7 which is not supported by Tensorflow.

    0 讨论(0)
  • 2020-11-22 08:23

    For pyCharm users:

    1. Check pip version: pip3 -V
    2. If pip is older than 9.0.1: py -3 -m pip install --upgrade pip
    3. Then: py -3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
    0 讨论(0)
  • 2020-11-22 08:24

    I figured out that TensorFlow 1.12.0 only works with Python version 3.5.2. I had Python 3.7 but that didn't work. So, I had to downgrade Python and then I could install TensorFlow to make it work.

    To downgrade your python version from 3.7 to 3.6

    conda install python=3.6.8
    
    0 讨论(0)
提交回复
热议问题