Python - pip install pandas,不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24745540/
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-08-19 05:06:41  来源:igfitidea点击:

Python - pip install pandas, not working

pythonpython-2.7pandaspip

提问by user3718365

I am trying to install pandas via pip install pandasbut when I do, I get the error:

我正在尝试通过以下方式安装熊猫,pip install pandas但是当我这样做时,出现错误:

Command python setup.py egg_info failed with error code 1 in c:\users[username]\appdata\local\temp\pip_build_[username]\pandas

命令 python setup.py egg_info failed with error code 1 in c:\users[username]\appdata\local\temp\pip_build_[username]\pandas

I followed the answer given hereand installed ez_setup.pywithout incident, but still get the error when doing pip install pandas.

我按照此处给出的答案进行安装,ez_setup.py没有发生任何事故,但在执行pip install pandas.

Thanks for any help, if I can provide more information please let me know.

感谢您的帮助,如果我能提供更多信息,请告诉我。

采纳答案by MattDMo

The easiest way to install pandasand its dependencies on Windows is to download the relevant packages from Christoph Gohlke's Python Extension Packages for Windowsrepository. You'll find the files for pandashereas well as a list of other required dependencies.

pandas在 Windows 上安装及其依赖项的最简单方法是从 Christoph Gohlke 的Python Extension Packages for Windows存储库下载相关包。您将在pandas此处找到文件以及其他所需依赖项的列表。

回答by Thom Ives

On Linux (Debian / Ubuntu varieties), when NOT installing inside a virtual environment, but in the main system, I find it best to just use the Synaptic Package Manager (because even the --user switch seems to fail when trying to install pandas without sudo). Search for pandas inside Synaptic PM. There's varieties for python 2 and 3.

在 Linux(Debian / Ubuntu 变体)上,如果不是在虚拟环境中安装,而是在主系统中安装,我发现最好只使用 Synaptic Package Manager(因为在尝试安装 pandas 时,即使 --user 开关似乎也失败了没有sudo)。在 Synaptic PM 中搜索 pandas。python 2和3有变种。

enter image description here

在此处输入图片说明

However, on linux, I have generally found the cleanest, easiest, and overall safest approach to be creating virtual environments and then use pip install <package name>inside the virtual environment. I believe this would be best on Windows too.

但是,在 linux 上,我通常发现创建虚拟环境然后pip install <package name>在虚拟环境中使用是最干净、最简单和总体上最安全的方法。我相信这在 Windows 上也是最好的。

回答by user9223746

I installed Pandas package following procedure listed after the following disclaimer section: Disclaimer: - I don't consider myself a computer expert so follow the instructions at your own risk.
- My procedure worked on my windows computer - My windows computer has python 2.7 installed from python.org - My python GUI is IDLE - I don't recall installing pip, it is possible that it installs at the time of installing python 2.7 from python.org (not sure) - The directory in which my pip.exe is located is under C:\Python27\Scripts

我按照以下免责声明部分列出的步骤安装了 Pandas 软件包: 免责声明: - 我不认为自己是计算机专家,因此请自担风险按照说明操作。
- 我的程序在我的 Windows 计算机上运行 - 我的 Windows 计算机从 python.org 安装了 python 2.7 - 我的 python GUI 处于空闲状态 - 我不记得安装 pip,它可能是在从 python 安装 python 2.7 时安装的.org(不确定) - 我的 pip.exe 所在的目录在 C:\Python27\Scripts 下

Procedure:

程序:

  1. Open a command window for the directory under which you have pip.exe, (in my case is Scripts). The prompt looks like this in my case: C:\Python27\Scripts>
  2. At the prompt type pip install pandas. The prompt looks like this in my case: C:\Python27\Scripts>pip install pandas
  3. Press ENTER key. You should see message: "Collecting pandas" being displayed in the command window.
  4. Once the system completes collecting pandas, you should see message "Successfully installed pandas-0.22.0" , or similar depending on version collected.
  1. 打开 pip.exe 所在目录的命令窗口(在我的例子中是 Scripts)。在我的情况下,提示如下所示:C:\Python27\Scripts>
  2. 在提示符下输入 pip install pandas。在我的情况下,提示如下所示:C:\Python27\Scripts>pip install pandas
  3. 按输入键。您应该会在命令窗口中看到消息:“Collecting pandas”。
  4. 系统完成熊猫收集后,您应该会看到消息“Successfully installed pandas-0.22.0”或类似信息,具体取决于收集的版本。

Picture shows steps 1 -4 as shown in my computer command window.collecting_pandas

图片显示了我的电脑命令窗口中所示的步骤 1 -4。收藏熊猫