Installed package with Anaconda, cannot be imported into Python

Forgive me, but I am new to python. I installed the package (theano) using conda install theano

and when I type the conda list

package exists

However, when I go into the python interpreter, run it python

and try to import it with import theano

, I get an error: "there is no module named theano" and when I list all python modules, theano doesn't exist.

What am I missing?

+11


source to share


5 answers


Probably due to the fact that you have multiple python envs installed on your machine. when you do which python

you will probably end up with native python installed on your machine. i.e/usr/bin/python

You want to use Python, which came when you installed Anaconda. Just add the Anaconda path to the beginning of your $PATH

. (To do this, you will probably need to edit the file ~/.bashrc

(or the equivalent file for your shell), then source ~/.bashrc

.



Next time you start python

, import theano

you will be successful.

+3


source


Do you have another Python installation on your system? You can run "which python" in your terminal to determine which Python to use.



+2


source


So I had the same problem too, it turned out that I called my own file with the same modular name (graphviz) and he tried to import it instead ... It took me a while before I figured it out!

0


source


I had a base environment where I installed keras_vggface using conda (sudo pip install git + https://github.com/rcmalli/keras-vggface.git : Courtesy: https://machinelearningmastery.com/how-to-perform -face-recognition-with-vggface2-convolutional-neural-network-in-keras / ). Launched anaconda navigator from base (post conda activate base

), keras_vggface import failed.

When base

deactivated and on the python command line the import worked fine. which python

detects the one in the Anaconda bin directory. Now I did pip3 install keras_vggface

being in base

.

I can now import the module from base

and at the python prompt and also from the jupyter notebook launched from the base via anaconda-navigator.

Note: this is not expert advice on how to do this; please use this experience with a pinch of salt.

0


source


After installing Anaconda, you usually need to close and reopen the terminal window. Have you tried this?

-1


source







All Articles