TensorFlow not found using pip

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

    This worked for me with Python 2.7 on Mac OS X Yosemite 10.10.5:

    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
    
    0 讨论(0)
  • 2020-11-22 08:32

    For windows this worked for me,

    Download the wheel from this link. Then from command line navigate to your download folder where the wheel is present and simply type in the following command -

    pip install tensorflow-1.0.0-cp36-cp36m-win_amd64.whl

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

    The URL to install TensorFlow in Windows, below is the URL. It worked fine for me.

    python -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:32

    Nothing here worked for me on Windows 10. Perhaps an updated solution below that did work for me.

    python -m pip install --upgrade tensorflow.

    This is using Python 3.6 and tensorflow 1.5 on Windows 10

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

    Here is my Environment (Windows 10 with NVIDIA GPU). I wanted to install TensorFlow 1.12-gpu and failed multiple times but was able to solve by following the below approach.

    This is to help Installing TensorFlow-GPU on Windows 10 Systems

    Steps:

    1. Make sure you have NVIDIA graphic card

    a. Go to windows explorer, open device manager-->check “Display Adaptors”-->it will show (ex. NVIDIA GeForce) if you have GPU else it will show “HD Graphics”

    b. If the GPU is AMD’s then tensorflow doesn’t support AMD’s GPU

    1. If you have a GPU, check whether the GPU supports CUDA features or not.

    a. If you find your GPU model at this link, then it supports CUDA.

    b. If you don’t have CUDA enabled GPU, then you can install only tensorflow (without gpu)

    1. Tensorflow requires python-64bit version. Uninstall any python dependencies

    a. Go to control panel-->search for “Programs and Features”, and search “python”

    b. Uninstall things like anaconda and any pythons related plugins. These dependencies might interfere with the tensorflow-GPU installation.

    c. Make sure python is uninstalled. Open a command prompt and type “python”, if it throws an error, then your system has no python and your can proceed to freshly install python

    1. Install python freshly

    a.TF1.12 supports upto Python 3.6.6. Click here to download Windows x86-64 executable installer

    b. While installing, select “Add Python 3.6 to PATH” and then click “Install Now”.

    c. After successful installation of python, the installation window provides an option for disabling path length limit which is one of the root-cause of Tensorflow build/Installation issues in Windows 10 environment. Click “Disable path length limit” and follow the instructions to complete the installation.

    d. Verify whether python installed correctly. Open a command prompt and type “python”. It should show the version of Python.

    1. Install Visual Studio

    Visual Studio 2017 Community

    a. Click the "Visual Studio Link" above.Download Visual Studio 2017 Community.

    b. Under “Visual Studio IDE” on the left, select “community 2017” and download it

    c. During installation, Select “Desktop development with C++” and install

    1. CUDA 9.0 toolkit

    https://developer.nvidia.com/cuda-90-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal

    a. Click "Link to CUDA 9.0 toolkit" above, download “Base Installer”

    b. Install CUDA 9.0

    1. Install cuDNN

    https://developer.nvidia.com/cudnn

    a. Click "Link to Install cuDNN" and select “I Agree To the Terms of the cuDNN Software License Agreement”

    b. Register for login, check your email to verify email address

    c. Click “cuDNN Download” and fill a short survey to reach “cuDNN Download” page

    d. Select “ I Agree To the Terms of the cuDNN Software License Agreement”

    e. Select “Download cuDNN v7.5.0 (Feb 21, 2019), for CUDA 9.0"

    f. In the dropdown, click “cuDNN Library for Windows 10” and download

    g. Go to the folder where the file was downloaded, extract the files

    h. Add three folders (bin, include, lib) inside the extracted file to environment

    i. Type “environment” in windows 10 search bar and locate the “Environment Variables” and click “Path” in “User variable” section and click “Edit” and then select “New” and add those three paths to three “cuda” folders

    j. Close the “Environmental Variables” window.

    1. Install tensorflow-gpu

    a. Open a command prompt and type “pip install --upgrade tensorflow-gpu”

    b. It will install tensorflow-gpu

    1. Check whether it was correctly installed or not

    a. Type “python” at the command prompt

    b. Type “import tensorflow as tf

    c. hello=tf.constant(‘Hello World!’)

    d. sess=tf.Session()

    e. print(sess.run(hello)) -->Hello World!

    1. Test whether tensorflow is using GPU

    a. from tensorflow.python.client import device_lib print(device_lib.list_local_devices())

    b. print(device_lib.list_local_devices())

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

    If you're trying to install tensorflow in anaconda and it isn't working, then you may need to downgrade python version because only 3.6.x is currently supported while anaconda has the latest version.

    1. check python version: python --version

    2. if version > 3.6.x then follow step 3, otherwise stop, the problem may be somewhere else

    3. conda search python

    4. conda install python=3.6.6

    5. Check version again: python --version

    6. If version is correct, install tensorflow (step 7)

    7. pip install tensorflow

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