3

I am running command to upgrade tensorflow, But always getting below error.

Could not find a version that satisfies the requirement tensorflow-gpu (from versions: )

I have tried below commands :

pip3 install --upgrade tensorflow

pip3 install --upgrade tensorflow-gpu
Jitesh Mohite
  • 31,138
  • 12
  • 157
  • 147
  • That error appears at the bottom of [this related](https://stackoverflow.com/questions/40884668/installing-tensorflow-on-windows-python-3-6-x?rq=1) as well -- have you tried the solutions listed there? (More the Python version / package locations / package requirements suggestions than the Windows-specific ones) – jedwards Sep 09 '17 at 05:28
  • I have tried that also I am having python 3.6 install on my mac, and pip3 also working fine but when I tried with pip3 it gives above error but using pip it is working. Don't what is happening – Jitesh Mohite Sep 09 '17 at 05:35

3 Answers3

6

I have a checklist for Could not find a version that satisfies the requirement XYZ errors:

pip version check

What python version does the pip you're using refer to - is it the correct one? Imagine you have python3.4 and python3.5 installed and using pip3 command that is symlinked to pip3.4 while you assume it is symlinked to pip3.5. So issue first:

$ pip3 -V | grep -o "(.*)"

and verify the correct python version is printed. If it's not, then you have to find the correct pip executable: first check if you have version-specific commands available (e.g.

$ which pip3.6

for python3.6) and verify it is pointing to the correct python version with the command above (e.g. $ pip3.6 -V | grep -o "(.*)"). If there is no version-specific pip, start searching for the correct executable in the sys.prefix's bin subdirectory. Example on my machine:

$ python3.6 -c "import sys; print(sys.prefix)" | xargs -I {} find {}/bin -name pip*
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3.6
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3

platform check

You may have a platform mismatch on your target machine. Check what platform is recognized by pip:

$ python3.6 -c "import pip; print(pip.pep425tags.get_platform())"

For pip newer than 10.0:

$ python3.6 -c "import pip._internal as pip; print(pip.pep425tags.get_platform())"

The output should be macosx_10_11_x86_64 or newer (e.g. macosx_10_13_x86_64). If you have an older OSX, you will have to build TensorFlow from source because prebuilt packages exist for MacOS 10.11 and higher only.

Other platforms supported are: manylinux1_x86_64 (so all the 64bit Linux distros with glibc>2.5 should do just fine, no 32bit distros or some exotic ones like Alpine with musl) and win_amd64 (64bit Windows).

ABI check

A less common problem is the ABI mismatch: you can check your platform's ABI with

$ python3.6 -c "import pip; print(pip.pep425tags.get_abi_tag())"

For pip newer than 10.0:

$ python3.6 -c "import pip._internal as pip; print(pip.pep425tags.get_abi_tag())"

The supported ABI tags are currently: cp27m, cp27mu, cp33m, cp34m, cp35m, cp36m. The above command should print you one of the tags listed. If not, you will have to build/install from sources.

Last notes

A rare case could be a misconfigured PyPI index: run

$ pip3 install --upgrade tensorflow --verbose
Collecting tensorflow
  2 location(s) to search for versions of tensorflow:
  * https://pypi.python.org/simple/tensorflow/
  * https://my.pypi.server/base/dev/+simple/tensorflow/
...

Check if https://pypi.python.org/simple/tensorflow/ is in the list. If not, try the command

$ pip3 install --upgrade tensorflow --index-url=https://pypi.python.org/simple

If the installation succeeds, check if you have PIP_INDEX_URL environment variable set and clear it. If not, check if you have the file ~/.pip/pip.conf present and if it has index-url entry defined.

hoefling
  • 59,418
  • 12
  • 147
  • 194
0

Use virtualenv or anaconda to install tensorflow. I did it with anaconda on Mac.

ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46
0

if you have all of the proper libraries...

conda install tensorflow

if it shows error then try

pip install tensorflow-gpu

If the above pip install doesn't work, you might want to start from a clean anaconda install.

Syed Ali
  • 219
  • 3
  • 11