0

I'm on a Windows 10 work laptop (so I don't have administrator access) running Python 3.7 on Jupyter Notebook. I also have Miniconda3 Windows 64-bit installed for Python 3.8. I'm trying to import the library seaborn and keep getting errors. It looks like other people have posted on stack overflow about this issue, but after trying their solutions I'm still stumped. To start, like every other library I used (e.g. pandas, numpy, scipy, etc.) I had the following line of code:

import seaborn as sns

And get the error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-22-a84c0541e888> in <module>
----> 1 import seaborn as sns

ModuleNotFoundError: No module named 'seaborn'

So, I went to this page and followed the answer (typing "!pip install Seaborn" into the iPython command prompt), and still got the same error in Jupyter after a successful run in iPython. I also typed that same code into a line in Jupyter, got the same success message for it (lots of "Requirement already satisfied" messages), and the same error for the "import seaborn as sns" line after. I should note that per this page, I also tried adding the code "-- user" at the end of the install line. The final page I looked at instructed me to type in the following code:

import sys
print(sys.path)

After that, I'm supposed to enter:

sys.path.append('<path to package in your system>')
import seaborn

The print(sys.path) shows a bunch of filepaths (five with a "site-packages" folder), which I think is because I have ArcGIS Pro installed on this laptop as well. I don't know what step to go with at this point, but I think if I am able to figure out which filepath to put in the sys.path.append command, I should be good to go. Happy to hear possible other ways to resolve this, too. Thank you!

  • 1
    Can you try `%pip install seaborn` in ipython? That will use the `pip` associated with the python interpreter you are using. – jkr Dec 01 '20 at 18:52
  • @jakub I get the error: `'C:\Program' is not recognized as an internal or external command, operable program or batch file. Note: you may need to restart the kernel to use updated packages.` – cedarlake23 Dec 01 '20 at 20:43

0 Answers0