TensorFlow not found using pip

后端 未结 30 2490
有刺的猬
有刺的猬 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:12

    You need to use right version of Python and pip

    On Windows 10, with Python 3.6.X version I was facing same then after checking deliberately , I noticed I had Python-32 bit installation on my 64 bit machine. Remember TensorFlow is only compatible with 64bit installation of python. Not 32 bit of Python

    If we download Python from python.org , the default installation would be 32 bit. So we have to download 64 bit installer manually to install Python 64 bit. And then add below to PATH environment.

    C:\Users\AppData\Local\Programs\Python\Python36
    C:\Users\AppData\Local\Programs\Python\Python36\Scripts
    

    Then run gpupdate /Force on command prompt. If python command doesnt work for 64 bit restart your machine.

    Then run python on command prompt. It should show 64 bit

    C:\Users\YOURNAME>python
    Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    

    Then run below command to install tensorflow CPU version(recommended)

    pip3 install --upgrade tensorflow
    

    October 2020 update:

    Tensorflow now supports Python 3.5.x through Python 3.8.x, but you still have to use a 64-bit version.

    If you need to run multiple versions of Python on the same machine, you can use a virtual environment to help manage them.

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

    I had the same problem and solved with this:

    # Ubuntu/Linux 64-bit, CPU only, Python 2.7
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
    # Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
    
    # Mac OS X, CPU only, Python 2.7:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
    
    # Mac OS X, GPU enabled, Python 2.7:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.1-py2-none-any.whl
    
    # Ubuntu/Linux 64-bit, CPU only, Python 3.4
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp34-cp34m-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
    # Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp34-cp34m-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, CPU only, Python 3.5
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp35-cp35m-linux_x86_64.whl
    
    # Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp35-cp35m-linux_x86_64.whl
    
    # Mac OS X, CPU only, Python 3.4 or 3.5:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl
    
    # Mac OS X, GPU enabled, Python 3.4 or 3.5:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.1-py3-none-any.whl
    

    Plus:

    # Python 2
    (tensorflow)$ pip install --upgrade $TF_BINARY_URL
    
    # Python 3
    (tensorflow)$ pip3 install --upgrade $TF_BINARY_URL
    

    Found on Docs.

    UPDATE!

    There are new links for new versions

    For example, for installing tensorflow v1.0.0 in OSX you need to use:

    https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py2-none-any.whl
    

    instead of

    https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
    
    0 讨论(0)
  • 2020-11-22 08:12

    Try this:

    export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl
    pip3 install --upgrade $TF_BINARY_URL
    

    Source: https://www.tensorflow.org/get_started/os_setup (page no longer exists)

    Update 2/23/17 Documentation moved to: https://www.tensorflow.org/install

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

    Updated 11/28/2016: TensorFlow is now available in PyPI, starting with release 0.12. You can type

    pip install tensorflow
    

    ...or...

    pip install tensorflow-gpu
    

    ...to install the CPU-only or GPU-accelerated version of TensorFlow respectively.


    Previous answer: TensorFlow is not yet in the PyPI repository, so you have to specify the URL to the appropriate "wheel file" for your operating system and Python version.

    The full list of supported configurations is listed on the TensorFlow website, but for example, to install version 0.10 for Python 2.7 on Linux, using CPU only, you would type the following command:

    $ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl
    
    0 讨论(0)
  • 2020-11-22 08:14
    1. Install python by checking Add Python to Path
    2. pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

    This works for windows 10.0

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

    Install Python 3.5.x 64 bit amd version here. Make sure you add Python to your PATH variable. Then open a command prompt and type

    python -m pip install --upgrade pip
    

    should give you the following result :

     Collecting pip
     Using cached pip-9.0.1-py2.py3-none-any.whl
     Installing collected packages: pip
     Found existing installation: pip 7.1.2
     Uninstalling pip-7.1.2:
     Successfully uninstalled pip-7.1.2
     Successfully installed pip-9.0.1
    

    Now type

     pip3 install --upgrade tensorflow
    
    0 讨论(0)
提交回复
热议问题