ImportError: No module named theano
Asked Answered
E

1

7

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.

Emmert answered 19/1, 2016 at 13:24 Comment(4)
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.Clearheaded
but when i run into python and import theano,it is also show the same errorEmmert
I found there are python 2.7 and python 3.2 in the same computer. When i use python -V it print python 2.7,but the pip install all the module into the python 3.2 folder.Emmert
Try to use pip2 to install Theano, better use virtualenv or even better use virtualenvwrapper.Suzetta
F
4

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
Ferrara answered 11/5, 2017 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.