tensorflow anaconda : pip install fails in newly created python 2.7 environment

Created on 15 Jul 2016  路  3Comments  路  Source: tensorflow/tensorflow

Environment info

Operating System:
(tf) :~/anaconda3/bin$ cat /proc/version
Linux version 4.4.0-31-generic (buildd@lgw01-16) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016

Steps to reproduce

  1. Follow https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html#anaconda-installation
  2. :~/anaconda3/bin$ ./conda create --name tf python=2
    Fetching package metadata .......
    Solving package specifications: ..........

Package plan for installation in environment /home/paddlescoot/anaconda3/envs/tf:

The following packages will be downloaded:

| package | build |
| --- | --- |
| python-2.7.12 | 1 12.1 MB |
| setuptools-23.0.0 | py27_0 455 KB |
| wheel-0.29.0 | py27_0 81 KB |
| pip-8.1.2 | py27_0 1.5 MB |

                                       Total:        14.1 MB

The following NEW packages will be INSTALLED:

openssl:    1.0.2h-1     
pip:        8.1.2-py27_0 
python:     2.7.12-1     
readline:   6.2-2        
setuptools: 23.0.0-py27_0
sqlite:     3.13.0-0     
tk:         8.5.18-0     
wheel:      0.29.0-py27_0
zlib:       1.2.8-3      

Proceed ([y]/n)? y

Fetching packages ...
python-2.7.12- 100%
setuptools-23. 100%
wheel-0.29.0-p 100%
pip-8.1.2-py27 100%

Extracting packages ...
Linking packages ...

:~/anaconda3/bin$ source activate tf
(tf) :~/anaconda3/bin$ ./conda info --envs

conda environments:

tf * /home/paddlescoot/anaconda3/envs/tf
root /home/paddlescoot/anaconda3

(tf) :~/anaconda3/bin$ python --version
Python 2.7.12 :: Continuum Analytics, Inc.

(tf) :~/anaconda3/bin$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

(tf) :~/anaconda3/bin$ pip install --upgrade $TF_BINARY_URL
Collecting tensorflow==0.9.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Downloading https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl (27.6MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 27.6MB 52kB/s
Collecting numpy>=1.8.2 (from tensorflow==0.9.0)
Downloading numpy-1.11.1-cp27-cp27mu-manylinux1_x86_64.whl (15.3MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 15.3MB 90kB/s
Collecting six>=1.10.0 (from tensorflow==0.9.0)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.9.0)
Using cached protobuf-3.0.0b2-py2.py3-none-any.whl
Requirement already up-to-date: wheel in /home/paddlescoot/anaconda3/envs/tf/lib/python2.7/site-packages (from tensorflow==0.9.0)
Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.9.0)
Downloading setuptools-24.0.3-py2.py3-none-any.whl (441kB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 450kB 1.3MB/s
Installing collected packages: numpy, six, setuptools, protobuf, tensorflow
Found existing installation: setuptools 23.0.0
Cannot remove entries from nonexistent file /home/paddlescoot/anaconda3/envs/tf/lib/python2.7/site-packages/easy-install.pth

(tf) :~/anaconda3/bin$ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org

import tensorflow as tf
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named tensorflow
quit()

(tf) :~/anaconda3/bin$ ls -ali /home/paddlescoot/anaconda3/envs/tf/lib/python2.7/site-packages/
numpy/ pip/ README setuptools.pth six.py wheel/
numpy-1.11.1.dist-info/ pip-8.1.2-py2.7.egg-info/ setuptools-23.0.0-py2.7.egg six-1.10.0.dist-info/ six.pyc wheel-0.29.0-py2.7.egg-info/

(tf) :~/anaconda3/bin$ ls -ali /home/paddlescoot/anaconda3/envs/tf/lib/python2.7/site-packages/
numpy/ pip/ README setuptools.pth six.py wheel/
numpy-1.11.1.dist-info/ pip-8.1.2-py2.7.egg-info/ setuptools-23.0.0-py2.7.egg six-1.10.0.dist-info/ six.pyc wheel-0.29.0-py2.7.egg-info/

What have you tried?

  1. Searching for similar issues.

Most helpful comment

This is not a TF bug, it's an anaconda thing. See https://github.com/ContinuumIO/anaconda-issues/issues/542 - this is one of the reasons I don't use anaconda anymore, it doesn't play nice with pip and its main selling points (package management and environments) now come bundled with python ...

As a workaround, do pip install --ignore-installed --upgrade pip setuptools before installing TF via pip.

All 3 comments

This is not a TF bug, it's an anaconda thing. See https://github.com/ContinuumIO/anaconda-issues/issues/542 - this is one of the reasons I don't use anaconda anymore, it doesn't play nice with pip and its main selling points (package management and environments) now come bundled with python ...

As a workaround, do pip install --ignore-installed --upgrade pip setuptools before installing TF via pip.

Great! Thanks very much @ptc-swalk.

Thanks

Was this page helpful?
0 / 5 - 0 ratings