Seaborn library is already installed in my Jupyter Notebook still not able to import the library. The same error I'm getting: ImportError: cannot import name ‘Series’ from ‘pandas’ (unknown location)

Hello,

Whenever I am trying to import seaborn library this error is coming. seaborn library is already installed also I restarted kernel many times still nothing is working. Please resolve this issue for me, I’m struggling from two days.

ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import seaborn as sns

File C:\ProgramData\anaconda3\lib\site-packages\seaborn_init_.py:2
1 # Import seaborn objects
----> 2 from .rcmod import * # noqa: F401,F403
3 from .utils import * # noqa: F401,F403
4 from .palettes import * # noqa: F401,F403

File C:\ProgramData\anaconda3\lib\site-packages\seaborn\rcmod.py:5
3 import matplotlib as mpl
4 from cycler import cycler
----> 5 from . import palettes
8 all = [“set_theme”, “set”, “reset_defaults”, “reset_orig”,
9 “axes_style”, “set_style”, “plotting_context”, “set_context”,
10 “set_palette”]
13 _style_keys = [
14
15 “axes.facecolor”,
(…)
50
51 ]

File C:\ProgramData\anaconda3\lib\site-packages\seaborn\palettes.py:9
5 import matplotlib as mpl
7 from .external import husl
----> 9 from .utils import desaturate, get_color_cycle
10 from .colors import xkcd_rgb, crayons
11 from ._compat import get_colormap

File C:\ProgramData\anaconda3\lib\site-packages\seaborn\utils.py:17
14 import matplotlib.pyplot as plt
15 from matplotlib.cbook import normalize_kwargs
—> 17 from seaborn._core.typing import deprecated
18 from seaborn.external.version import Version
19 from seaborn.external.appdirs import user_cache_dir

File C:\ProgramData\anaconda3\lib\site-packages\seaborn_core\typing.py:8
5 from typing import Any, Optional, Union, Tuple, List, Dict
7 from numpy import ndarray # TODO use ArrayLike?
----> 8 from pandas import Series, Index, Timestamp, Timedelta
9 from matplotlib.colors import Colormap, Normalize
12 ColumnName = Union[
13 str, bytes, date, datetime, timedelta, bool, complex, Timestamp, Timedelta
14 ]

ImportError: cannot import name ‘Series’ from ‘pandas’ (unknown location)

  • Do you have a file named pandas.py in your directory with the notebook?
  • What does import pandas; print(pandas.__version__) show?

I run the code conda.install seaborn on anaconda prompt. So now it’s working fine.
Thanks for your quick reply @krassowski .