TensorFlow not found using pip

2019-01-01 02:33发布

I'm trying to intstall TensorFlow using pip:

$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

What am I doing wrong? So far I've used Python and pip with no issues.

30条回答
只若初见
2楼-- · 2019-01-01 03:16

If you are using the Anaconda Python installation, pip install tensorflow will give the error stated above, shown below:

Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

According to the TensorFlow installation page, you will need to use the --ignore-installed flag when running pip install.

However, before this can be done see this link to ensure the TF_BINARY_URL variable is set correctly in relation to the desired version of TensorFlow that you wish to install.

查看更多
梦寄多情
3楼-- · 2019-01-01 03:17

You can install it with:

pip3 install --upgrade tfBinaryURL  # Python 3.n

where last versions of tfBinaryURL are here:

https://www.tensorflow.org/install/install_mac#the_url_of_the_tensorflow_python_package

See point 7 in TF instructions on Google page:

If Step 6 failed (typically because you invoked a pip version lower than 8.1), install TensorFlow in the active Virtualenv environment by issuing a command of the following format:

pip3 install --upgrade tfBinaryURL  # Python 3.n

As example in July 2018:

pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl
查看更多
旧时光的记忆
4楼-- · 2019-01-01 03:18

I had this problem on OSX Sierra 10.12.2. It turns out I had the wrong version of Python installed (I had Python 3.4 but tensorflow pypi packages for OSX are only for python 3.5 and up).

The solution was to install Python 3.6. Here's what I did to get it working. Note: I used Homebrew to install Python 3.6, you could do the same by using the Python 3.6 installer on python.org

brew uninstall python3
brew install python3
python3 --version # Verify that you see "Python 3.6.0"
pip install tensorflow # With python 3.6 the install succeeds
pip install jupyter # "ipython notebook" didn't work for me until I installed jupyter
ipython notebook # Finally works!
查看更多
余生无你
5楼-- · 2019-01-01 03:18

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**

查看更多
低头抚发
6楼-- · 2019-01-01 03:20

Install Python 3.5.x 64 bit amd version here. Make sure you add Phython 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
查看更多
无与为乐者.
7楼-- · 2019-01-01 03:20

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

查看更多
登录 后发表回答