1

I keep getting the error: ModuleNotFoundError: No module named 'seaborn' when trying to import seaborn. enter image description here

I have installed seaborn using both pip install seaborn and conda install seaborn. enter image description here

I saw on seaborn that I am not the only one who has had this issue, but I have not been able to resolve this problem, how can I check and updated that my pip/conda points to the same installation as my interpreter?enter image description here

EDIT:
I have tried running !pip install seaborn in the notebook, but this still does not work. I have also created my own conda env and installed seaborn (it shows base in the photos) but this also did not work.enter image description here

everwitt7
  • 191
  • 1
  • 3
  • 12
  • You installed seaborn to the (base) environment in conda. Are you running your jupyter notebook from the same environment? – Madjazz Dec 13 '20 at 20:12
  • Can you try running `!pip install seaborn` from your jupyter cell and then try importing? – ksha Dec 13 '20 at 20:12
  • a more robust way is to use [line magic %pip (SO explanation)](https://stackoverflow.com/a/56190436/10413145) to directly install the package with the kernel you are using – Marc Dec 13 '20 at 20:47
  • 2
    Can you run `import sys` and `print(sys.executable)` inside your jupyter notebook? Does it return `/opt/miniconda3/bin/python`? – FlyingTeller Dec 14 '20 at 09:16
  • running print(sys.executable) does in fact point to the wrong path, it points to: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 instead of /opt/miniconda3/bin/python – everwitt7 Dec 14 '20 at 22:43

1 Answers1

5

you might have an old version of Jupyter notebook, so need to try this command to install it in the current kernel.

import sys
!{sys.executable} -m pip install seaborn

In the New Jupyter version (2019) can be installed simply as:

%pip install seaborn

Note: Answer from different question!

fdaa Cham
  • 53
  • 1
  • 5