I can't get Seaborn to import - python

I'm trying to add Seaborn to my Anaconda3 python installation, and get multiple failure codes. It successfully installed using conda ... but won't import. After multiple installs/deletion/reinstalls of scipy, numpy, and seaborn, I get the following error message. I'm running Python 3.9.12, numpy 1.22.0 (downgraded from 1.23 due to prev error message stating had to be < 1.23 for Seaborn to install -- on a Windows 10. Any suggestions would be appreciated.
I can't post an image yet, so here's a summary of the error message with the failure points
code:
import Seaborn as sns
ImportError
...
import seaborn as sns
from .rcmod import * # noqa:F401, F403
from .import palettes
from . import _arpack
ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.

It is not issue of seaborn. First of all uninstall numpy using this command
pip uninstall -y numpy
Then uninstall setuptools with this command
pip uninstall -y setuptools
Now, reinstall setuptools with this command
pip install setuptools
Then, You can reinstall numpy with this command
pip install numpy
Now, Your error must be solved.

Related

cannot import name 'inv' from 'numpy.linalg' (unknown location)

import matplotlib.animation as animation
The error show up when I import matplotlib.animation
I tried to reinstall numpy scipy and matplotlib, but it didn't work
environment list
-torch=1.12.1
--numpy=1.23.4
--scipy=1.9.2
--networkx=2.8.7
--matplotlib=3.6.1
--dgl=0.5.1
I had the same problem yesterday, and I found out that the error didn't only occur in matplotlib, but actually in other packages (at least for me). So I figured out that the error was from numpy. I just uninstalled numpy and installed it again:
pip uninstall -y numpy
pip install numpy
Hope it works for you!

Facing Import Error while running the imported packages in jupyter notebook of VS code

Error: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_xcb_connect'
Below is the piece of code I'm trying execute
Declarations and imports
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
The complete Screenshot
enter image description here
Thanks in advance for helping out
I faced the same issue on Mac M1 chip with pyodbc library, I resolved this and it worked for me, hope it will helps you as well.
I managed to fix it with a --no-binary option which forces pip to compile the module from source instead of installing from precompiled wheel.
pip uninstall pyodbc
pip install --no-binary :all: pyodbc
The error seems to happen on Mac M1. Reverting to 9.0.0 fixes the issue.
I think it's related to this issue: https://github.com/python-pillow/Pillow/issues/6015.
Running: pip install pillow==9.0.0 should fix it.

Cannot import matplotlib on Spyder after conda installation

I installed matplotlib on Anaconda Prompt with conda install -c conda-forge matplotlib.
However, when I run import matplotlib.pyplot as plt on Spyder 4.1.5 (with Python 3.7), I got an error message:
ModuleNotFoundError: No module named 'matplotlib.pyplot'
Before getting this error message, I installed matplotlib_scalebar with conda install -c conda-forge matplotlib-scalebar. I had no issue importing matplotlib.pyplot before this, and I suspect that installing this might have caused the problem.
Under C:\ProgramData\Anaconda3\Lib\site-packages, I have folders with the following names:
matplotlib
matplotlib-3.0.2.dist-info
matplotlib-3.3.2.dist-info
I'm not sure if having different folders (3.0.2 and 3.3.2) is an issue here.
How can I fix this No module issue?

Trouble installing 'matplotlib'

Cant' install 'matplotlib.pyplot' on Windows 10, Python 3.7
I tried 'pip install matplotlib.pyplot' and received an error
Here's the exact error code:
Could not find a version that satisfies the requirement matplotlib.pyplot (from versions: )
No matching distribution found for matplotlib.pyplot
Don't use pip install matplotlib.pyplot, use pip install matplotlib
matplotlib.pyplot is calling pyplot from the module matplotlib. What you want is the module, matplotlib. Then from idle or wherever you are running this, you can call matplotlib.pyplot
Try just using pip install on your command line (or terminal):
'pip install matplotlib'
I hope it helps.
BR

Cannot import name cbook in jupyter

I have matplotlib-2.2.3 installed. When I used matplotlib in jupyter, it throws the following error:
ImportError: cannot import name cbook in jupyter
All is OK when I run the code in PyCharm. I used python 2.7 and I have tried many suggestions like that in ImportError: cannot import name cbook but none worked.
I finally found the solution that downgrade the matplotlib and six, and that solves my question.
pip install six==1.10.0
pip install matplotlib==2.0.2

Categories