I am using Ubuntu 14.04. I am trying to use the tensorflow module, but although I have it installed, and installed it the same way I would install any other pkg or module, it is not recognized by python as being installed. Even though pip says it is installed... I am not sure what the hell is going on.
See for yourselves:
$ sudo pip install tensorflow
The directory '/home/tex/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/tex/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: tensorflow in /home/tex/.local/lib/python2.7/site-packages
Requirement already satisfied: six>=1.10.0 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: markdown>=2.6.8 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: bleach==1.5.0 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: backports.weakref==1.0rc1 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: html5lib==0.9999999 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: werkzeug>=0.11.10 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: mock>=2.0.0 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: numpy>=1.11.0 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: wheel in /usr/lib/python2.7/dist-packages (from tensorflow)
Requirement already satisfied: protobuf>=3.2.0 in /home/tex/.local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /home/tex/.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already satisfied: pbr>=0.11 in /home/tex/.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already satisfied: setuptools in /home/tex/.local/lib/python2.7/site-packages (from protobuf>=3.2.0->tensorflow)
But when I try to import it from python, this is what I get:
$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
Why is this happening? I am also having a much weirder error. I am using flask on a virtualenv. When I start my virtualenv, it does not recognize that numpy is installed, even though it is, and it is recognized outside the virtualenv. Let me show you:
(venv)tex@ubuntu:~/scratch/ilya/mock$ sudo pip install numpy
The directory '/home/tex/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/tex/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: numpy in /home/tex/.local/lib/python2.7/site-packages
(venv)tex@ubuntu:~/scratch/ilya/mock$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
However, when I exit the virtualenv...
tex@ubuntu:~/scratch/ilya/mock$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Edit: not a possible duplicate because the link posted doesn't address the same issues... so... basically, a completely different question.