【问题标题】:I am facing this issue in seaborn import:我在 seaborn 进口中面临这个问题:
【发布时间】:2020-06-14 14:07:25
【问题描述】:

当我尝试在 Jupiter notebook 中运行以下行时

> 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'

依赖版本如下:

Python 3.6.3

conda 4.8.2

numpy 1.18.0

熊猫 1.0.1

scipy 1.1.0

matplotlib 3.1.3

这里有什么问题?

【问题讨论】:

    标签: python pandas jupyter-notebook seaborn


    【解决方案1】:

    好的,

    所以我还是不知道,这有什么问题,但是我确实解决了问题。

    我只是卸载了 seaborn

    pip3 uninstall seaborn
    

    然后重新安装

    pip3 install seaborn
    

    成功了,这次没有错误。

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

    如果有人可以帮忙,请分享。

    【讨论】:

      【解决方案2】:

      问题是 seaborn 似乎在使用 pandas 的私有方法。已向 pandas 和 seaborn 开发人员报告了该问题(请参阅 https://github.com/pandas-dev/pandas/issues/16971https://github.com/mwaskom/seaborn/pull/1241),这两个开发人员都在以后的版本中发布了修复程序。

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

      【讨论】:

        猜你喜欢
        • 2020-07-25
        • 2021-05-28
        • 2022-01-18
        • 1970-01-01
        • 1970-01-01
        • 2023-02-22
        • 1970-01-01
        • 1970-01-01
        • 2022-11-10
        相关资源
        最近更新 更多