No module found error for every conda package in a

2019-06-11 13:24发布

问题:

After installing scikit learn latest version 19 using conda in anaconda jupyter ,all package showing no module found error - scikit learn , numpy ,matplotlib etc NO module found erroe for all conda package after uninstalling and reinstallling its has same module problem

my kerenel specs sana@skb-linux:~$ . activate my_env (my_env) sana@skb-linux:~$ jupyter kernelspec list Available kernels: python3 /home/sana/anaconda3/envs/my_env/share/jupyter/kernels/python3

my code # scipy import scipy print('scipy: %s' % scipy.version) ModuleNotFoundError Traceback (most recent call last) in () 1 # scipy ----> 2 import scipy 3 print('scipy: %s' % scipy.version)

ModuleNotFoundError: No module named 'scipy'

回答1:

You can check for the install packages by typing !conda list in the notebook and check for scikit-learn package is there or not. If it's not present then you can install it by !pip install scikit-learn or !conda install -c anaconda scikit-learn

later try import sklearn it should work!.

There is a useful source here, including how to update or upgrade packages..



回答2:

final solution: first need activate the environment you are working and install conda package in that particular environment using conda install and do need not to install outside of your environment

sana@skb-linux:~$ . activate my_env (my_env) sana@skb-linux:~$ conda install scikit-learn Solving environment: done

so the sklearn package is installed in your particular environment(in my case its installed my_env)