Python 我在seaborn import中面临这个问题:

Python 我在seaborn import中面临这个问题:,python,pandas,jupyter-notebook,seaborn,Python,Pandas,Jupyter Notebook,Seaborn,当我试着在Jupiter笔记本中运行以下行时 > import seaborn as sns 我得到这个错误: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-ed9806ce3570&

当我试着在Jupiter笔记本中运行以下行时

> import seaborn as sns     
我得到这个错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-ed9806ce3570> in <module>()
----> 1 import seaborn as sns

~/anaconda3/lib/python3.6/site-packages/seaborn/__init__.py in <module>()
      8 from .palettes import *
      9 from .regression import *
---> 10 from .categorical import *
     11 from .distributions import *
     12 from .timeseries import *

~/anaconda3/lib/python3.6/site-packages/seaborn/categorical.py in <module>()
      5 from scipy import stats
      6 import pandas as pd
----> 7 from pandas.core.series import remove_na
      8 import matplotlib as mpl
      9 from matplotlib.collections import PatchCollection

ImportError: cannot import name 'remove_na'
---------------------------------------------------------------------------
ImportError回溯(最近一次呼叫最后一次)
在()
---->1作为sns导入seaborn
~/anaconda3/lib/python3.6/site packages/seaborn/\uuuu init\uuuuuu.py in()
8.从选项板导入*
9.回归进口*
--->10.分类进口*
11.进口分配*
12.从timeseries导入*
~/anaconda3/lib/python3.6/site-packages/seaborn/category.py in()
5来自scipy导入统计
6进口熊猫作为pd
---->7从pandas.core.series导入删除\u na
8将matplotlib导入为mpl
9从matplotlib.collections导入PatchCollection
ImportError:无法导入名称“remove\u na”
依赖项版本如下所示:

Python 3.6.3

康达4.8.2

numpy 1.18.0

熊猫1.0.1

scipy 1.1.0

matplotlib 3.1.3

这里有什么问题?

好的

所以我仍然不知道这是怎么回事,但我确实解决了问题。

我只是卸载了seaborn

pip3 uninstall seaborn
然后重新安装

pip3 install seaborn
它成功了,这次没有错误

但我还是不知道,第一次出了什么问题。


如果有人能帮忙,请分享。

问题是seaborn似乎在使用熊猫的私人方法。pandas和seaborn开发人员(请参阅和)都收到了该问题的报告,他们在更高版本中发布了修复程序

固定版本在pip上可用,但在Ubuntu的软件包上还没有(截至2020年8月)。 但是,对于那些不希望安装pip的人来说,修复程序非常简单,可以手动应用(请参阅上面的pull请求)