Pandas Seaborn 安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24224558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:14:01  来源:igfitidea点击:

Pandas Seaborn Install

python-2.7pandasseaborn

提问by user3741230

On Ubuntu 12.04 LTS running Python 2.7 I'm getting an install error from attempting to add the great looking Seaborn plotting package to my existing Pandas environment which is running fine.

在运行 Python 2.7 的 Ubuntu 12.04 LTS 上,我尝试将外观精美的 Seaborn 绘图包添加到运行良好的现有 Pandas 环境时出现安装错误。

Here's a snippet from the console containing the errors:

这是控制台中包含错误的片段:

~$ pip install seaborn
running install_lib

creating /usr/local/lib/python2.7/dist-packages/seaborn

error: could not create '/usr/local/lib/python2.7/dist-packages/seaborn': 
Permission denied


Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tm/pip_build_moj0/seaborn/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-LvVao5-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_mojo/seaborn
Storing debug log for failure in /home/mojo/.pip/pip.log

Anyone have a resolution tip not available on the Seaborn github site?

有人有 Seaborn github 站点上没有的解决方法提示吗?

采纳答案by Andy Hayden

I think the easiest way is to use sudo:

我认为最简单的方法是使用 sudo:

sudo pip install seaborn

It requires sudo permission to write to usr/local/lib.

它需要 sudo 权限才能写入usr/local/lib.

Note: If you're using anaconda you won't need sudo to install via pip, once you've conda installed pip, though seaborn may also be available via conda.

注意:如果你使用的是 anaconda,你不需要 sudo 来通过 pip 安装,一旦你安装了 conda pip,尽管 seaborn 也可以通过 conda 获得。

回答by Emre

Personal installation is a good habit to get into:

个人安装是进入的好习惯:

pip install --user seaborn

pip install --user seaborn

However, there is an even easier way: as of writing python XY maintains up-to-date builds of pandas andseaborn(among other useful packages), so all you have to do is

但是,还有一种更简单的方法:在编写python XY 时,会维护最新版本的 pandasseaborn(以及其他有用的软件包),因此您所要做的就是

sudo add-apt-repository ppa:pythonxy/pythonxy-devel
sudo apt-get update
sudo apt-get install python-seaborn python-pandas

Note that this will only work with python 2.x; you will still need pip3to install the python 3.x packages.

请注意,这仅适用于 python 2.x;您仍然需要pip3安装 python 3.x 软件包。