Jupyter laptop import error: no module named "matplotlib"

I am a Ubuntu 16.4 user and I installed anaconda3 and use both the python2 and python3 kernels.

>>> List of jupyter kernel specifications Available kernels: python2 / home / peterkim / .local / share / jupyter / kernels / python2 python3 / home / peterkim / anaconda3 / share / jupyter / kernels / python3

and ... the problem was that I don’t know where / how to install the packages so that in my python2 jupyter laptop there would be no error "module not named ...". I tried pip install matplotliband pip install matplotlib conda install matplotlibI also conda install matplotlib'/ home // anaconda2 / pkgs' in sys.path.

(I also installed anaconda2 in search of a way to use parallel kernels. After I realized that anaconda2 was not needed. But I did not remove it.)

screenshot

Thanks for helping me in advance!

+9
4

:

https://conda.io/docs/py2or3.html

Python 2.7 Anaconda3. , , , Anaconda (, matplotlib, numpy,...). , pip :

:

C:\Users\Felix>conda info --envs
# conda environments:
#
ipykernel_py2            D:\Anaconda\envs\ipykernel_py2
root                  *  D:\Anaconda

python 2 source activate <env> (Linux/OSX) activate <env> (Windows):

C:\Users\Felix>activate ipykernel_py2

(ipykernel_py2) C:\Users\Felix>

, pip :

(ipykernel_py2) C:\Users\Felix>pip install matplotlib
Collecting matplotlib
...
Successfully installed matplotlib-2.0.0

, .

+7

jupyter (pip3 install jupyter) python3, matplotlib pip3: pip3 install matplotlib

+5

, :

conda install matplotlib

matplotlib anaconda.

0

10:

  1. Conda. Python 3.x, Python 3 : c:\python3x\python -m venv c:\path\to\your\env.
  2. Python python -v.
  3. Python 3, env/Scripts/activate : env/Scripts/activate.
  4. matplotlib, pip3 install matplotlib.
0

Source: https://habr.com/ru/post/1674919/


All Articles