Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named theano

Tags:

python

pip

theano

I use the introduction in the deeplearning tutorials.

sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
sudo pip install Theano

There is no problem with numpy and scipy.test:

python -c "import numpy; numpy.test()"
python -c "import scipy; scipy.test()"

but when i use the the theano test:

python -c "import theano; theano.test()"

It told me "no module named theano" which confused me a lot.

like image 777
hunter Avatar asked Jan 19 '16 13:01

hunter


People also ask

Is there a Theano module in Python?

It told me "no module named theano" which confused me a lot. Obviously theano doesn't seem to be in the search path of your Python installation. Check out sys.path and verify that the module is located in one of the listed locations. I found there are python 2.7 and python 3.2 in the same computer.

What version of Python does pip install Theano?

When i use python -V it print python 2.7,but the pip install all the module into the python 3.2 folder. Try to use pip2 to install Theano, better use virtualenv or even better use virtualenvwrapper. In order to be certain of installing the version that will match your interpreter's and not pip's version of Python, you could try the following:

Can there be a clash of two modules'name?

It s possible that there is a clash of two modules' name. Sorry, something went wrong. Sorry, something went wrong. Sorry, something went wrong. Sorry, I meant to ask the content of pwd.


1 Answers

In order to be certain of installing the version that will match your interpreter's and not pip's version of Python, you could try the following:

sudo -H python -m pip install Theano

Which would load the pip module corresponding to your interpreter.

If you're not a system administrator of your computer, or you just prefer to avoid installing python packages system-wide, you can do the following

pip install --user Theano

Third possibility would be to use a virtualenv

virtualenv env
source env/bin/activate
pip install Theano
like image 171
tbobm Avatar answered Sep 22 '22 00:09

tbobm