【问题标题】:Not able to install seaborn libraries in python : Spyder无法在 python 中安装 seaborn 库:Spyder
【发布时间】:2021-09-02 01:07:00
【问题描述】:

我对这种 python 编程语言相当陌生。我已经在我的系统中安装了 anaconda、python 和 spyder(分别)。在 spyder 环境中工作时,我使用以下命令安装 seaborn 库

!pip install seaborn

我得到以下结果

\users\16111317\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (0.11.1)
Requirement already satisfied: pandas>=0.23 in c:\program files\spyder\pkgs (from seaborn) (1.2.4)
Requirement already satisfied: numpy>=1.15 in c:\program files\spyder\pkgs (from seaborn) (1.19.3)
Requirement already satisfied: matplotlib>=2.2 in c:\program files\spyder\pkgs (from seaborn) (3.4.2)
Requirement already satisfied: scipy>=1.0 in c:\program files\spyder\pkgs (from seaborn) (1.6.3)
Requirement already satisfied: pyparsing>=2.2.1 in c:\program files\spyder\pkgs (from matplotlib>=2.2->seaborn) (2.4.7)
Requirement already satisfied: cycler>=0.10 in c:\program files\spyder\pkgs (from matplotlib>=2.2->seaborn) (0.10.0)
Requirement already satisfied: python-dateutil>=2.7 in c:\program files\spyder\pkgs (from matplotlib>=2.2->seaborn) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\program files\spyder\pkgs (from matplotlib>=2.2->seaborn) (1.3.1)
Requirement already satisfied: pillow>=6.2.0 in c:\program files\spyder\pkgs (from matplotlib>=2.2->seaborn) (8.2.0)
Requirement already satisfied: six in c:\program files\spyder\pkgs (from cycler>=0.10->matplotlib>=2.2->seaborn) (1.16.0)
Requirement already satisfied: pytz>=2017.3 in c:\program files\spyder\pkgs (from pandas>=0.23->seaborn) (2021.1)

但是当我使用命令调用库时

import seaborn as sns

它给出了以下错误

Traceback (most recent call last):

  File "<ipython-input-3-a84c0541e888>", line 1, in <module>
    import seaborn as sns

ModuleNotFoundError: No module named 'seaborn'

有人可以帮忙

【问题讨论】:

  • 你安装了conda还是anaconda?这很可能是环境问题。你能确保seaborn和Spyder使用conda install seaborn和conda install -c anaconda spyder安装在conda环境中吗?
  • 我推荐使用Anaconda Distribution,它可能会让你的生活更轻松。所有软件包都安装为预编译的二进制文件。 Package List。如果您使用 Anaconda,请不要使用 pip 安装存在于 conda 生态系统中的软件包。使用conda install package。如果包不适用于conda install,则仅使用pip。使用pip 可能会破坏您的安装,因为pip 和conda 管理依赖关系的方式不同。

标签: python python-3.x seaborn spyder


【解决方案1】:

使用 cmd 安装 seaborn 库 开始 > 运行 > cmd 然后使用命令:

python -m pip install seaborn

这应该安装包,然后你可以使用python命令行检查 进口海运 也可以在 cmd 中使用命令查看已安装的包:

pip list

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-23
    • 1970-01-01
    • 2020-11-19
    • 1970-01-01
    • 1970-01-01
    • 2020-11-08
    • 2020-09-19
    相关资源
    最近更新 更多