Python does not import seaborn-package, although installed - python

I've installed the package using conda install seaborn in my terminal. This stated that the package was already installed.
When I try to import Seaborn into my editor (I'm using Canopy) and run a simple program, I am met with the following error:
ImportError: No module named seaborn.
What is the reason for this and how can I solve it?

Try this!! Include this in your code and wait for package to be downloaded.
I was pretty tired of not being able to download and install a new package and this worked for me-
import pip
pip.main(['install','seaborn'])
I got to know this from a youtube video-https://www.youtube.com/watch?v=7ExwdL770ZM
It works like a charm for me.

I don't know about conda but it probably installed Seaborn in a directory other than Python's directory. Try installing it with pip instead.
pip install Seaborn

try using
pip3 install seaborn
I had the same issue, I'm using Rodeo. This worked for me.

Your anaconda-based installation of Python is not the same as the one Canopy uses. Try using Canopy's package manager:
enpkg seaborn

Related

Install module in python locally

I have a very basic question. I want to install a new module on my computer in order to use it in Python (via Spyder). When I install the package via pip everything seems to work fine. When I want to import the package in my script it says that there is no module by that name (see scrennshot below)
Any suggestions what might be the problem?
Thanks a lot :)
screenshot of this problem
You're using pip3 to install.
Try installing using pip install nibabel.
Failing that, I would refer you to the following question:
Which pip is with which python?
This is a common pitfall of using different versions of Python and pip.
I think
/Applications/Spyder.app/Contents/MacOS/python -m pip install nibabel
or
/Applications/Spyder.app/Contents/MacOS/python -m pip3 install nibabel
will solve your problem
Thanks for asking the question.
Have tried conda install
Since we are in anaconda dev env.
If you are using windows
Windows: Click Start, search, or select Anaconda Prompt from the menu
and use that terminal
please find the reference
https://docs.anaconda.com/anaconda/install/verify-install/

ModuleNotFound seaborn in Python 3

I'm trying to use the seaborn module in the Spyder IDE. I've installed seaborn (and sklearn) through pip install (pip install seaborn, pip3 install seaborn, pip -m install seaborn, conda install seaborn). I've also tried uninstalling it and installing it again. I see it in my pip list. But when I go into Spyder and actually try to import it using "import seaborn as sns", it says "mo module named 'seaborn'".
I've installed other modules (pandas, numpy, etc), so I'm pretty sure my PATH is set appropriately. I found another thread but it was all about starting virtual environments to work with seaborn, which I'd rather not do.
Any ideas? Please keep in mind that I'm fairly a newbie, so I have a basic IDE setup.
You may want to check whether the Spyder you are using is the correct one.
You can check this with which spyder from the commandline.
It should report Spyder being in the same directory as pip and python are.
Also, check if you can import Seaborn when you are in a normal Python terminal.
This will help tracking down what part of this operation is the issue.
Spyder also has a console of its own. Try pip install seaborn in that terminal. Hopefully it will solve your problem.

Can't access Pandas

Hi I am having major trouble with shell.
I am not able to change the path for pip and python.
Python 3.7 is downloaded elsewhere.
Pip has an unknown path. I tried upgrading pip but it stored a blob of code and I don't know what to do with it.
Pandas not available on terminal (shell) which uses python 2.7.
Errors:
ImportError: No module named pandas
After pip install pandas I get the message: Successfully installed numpy-1.19.1 pandas-1.0.5 pytz-2020.1
I still get the message No module named pandas
please help. I have been really frustrated by this!
Have you tried pip3 install yet?
pip could default to the installation of pip for python2 as well.
Finally, if it is doable in your system, you may uninstall python 2 completely as it is out of support anyway, this would save you a lot of headache in the future!
Try
pip3 install pandas
and if that doesn't work, then try
pip install pandas
EDIT:
It sounds like you should try to run your code using python myfile.py instead of python3 myfile.py

unable to import numpy library in jupyter notebbok even if it was installed

I run into this problem in the following picture while importing numpy into jupyter notebook.
Please help:
Here is print(sys.path):
Could you try print(sys.path)?
I have had trouble with jupyter and multiple instances of python in the past. pip installing to one python and running jupyter on another python.
(This should probably be a comment, but I can't comment)
Uninstall numpy('pip uninstall numpy') then again reinstall ('pip install numpy').

Matplotlib not recognized as a module when importing in Python

I've been attempting to install Matplotlib for a graphing project in Python. In accordance with recommendation from the Matplotlib website, I installed Anaconda as a pre-packaged python distributor. Anaconda seems to have installed correctly.
To install matplotlib, I typed in the command line:
pip install matplotlib
Which brings up multiple messages stating: "Requirement already satisfied."
When in my python script I typed:
import matplotlib.pyplot as plt
I received an error message stating:
ImportError: No module named matplotlib.pyplot
I'm using an old Windows XP operating system.
I've looked everywhere for help, and have tried installing matplotlib numerous times via the command line! Any help would be greatly appreciated...
Thank you!!
Make sure your version of pip corresponds to your version of python. One way to do this is the following:
python -m pip install matplotlib
The -m for module means that it will look in the site-packages for that python for the pip module.
You can also do:
>>> import sys
>>> print("\n".join(sys.path))
to list the path as understood by python, then check whether matplotlib is indeed on one of the listed paths (usually site-packages).
To find the locations of pip and python use the following on the Windows console:
where python
where pip
From the path you should be able to determine whether pip and python are from the same package. If not, uninstall one of the python installations, or at least remove it from the PATH variable.

Categories