Installed anaconda python libraries cannot be imported

496 Views Asked by At

I'm setting up a Python/conda enviroment on Ubuntu. I installed some common Python libraries such as tensorflow via conda install or pip install. Via pip show ... I found out they are all installed in the following folder: /home/anaconda3/lib/python3.8/site-packages/. However, when running them in Spyder I get the ModuleNotFoundError: No module named 'tensorflow' error message, for about every library (including matplotlib).

How can I fix this? I read this post about how they apparently need to be installed in /home/anaconda3/envs/[name env]/lib/python3.7/site-packages/ (/home/anaconda3/envs/ is an empty folder for me). However, the quick fix mentioned doesn't work for me.

Is there some way to add /home/anaconda3/lib/python3.8/site-packages/, use it as default, or is their a way to reinstall packages such that they will work?

Curiously enough, I did manage to get pygrib working via conda install -c conda-forge pygrib=2.0.1, but I'm not sure whether this is the way to go for all packages and would like to know what this does differently.

0

There are 0 best solutions below