繁体   English   中英

在Ubuntu 12.04上安装Pandas失败

[英]Installation of Pandas fails on Ubuntu 12.04

根据Pandas社区页面( http://pandas.pydata.org/community.html ),我首先在这里发帖...

我正在尝试使用pip在运行Ubuntu 12.04.3(64位)的vanilla远程服务器上的虚拟环境中安装Pandas。 我已经安装了通常的嫌疑人(python-dev(2.7),numpy,scipy)。 Pandas没有安装,我不确定要更改或添加什么以确保发生这种情况。

我已经看到其他引用(没有相同的错误)暗示内存可能是一个问题; 远程服务器(Digital Ocean Droplet)只有512MB。

点差错误日志的尾部如下所示:

gcc: internal compiler error: Killed (program cc1)

Please submit a full bug report,

with preprocessed source if appropriate.

See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.

error: command 'gcc' failed with exit status 4

----------------------------------------

Command /srv/tp/venv/bin/python -c "import setuptools;__file__='/srv/tp/venv/build/pandas/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-0bOHrG-record/install-record.txt --install-headers /srv/tp/venv/include/site/python2.7 failed with error code 1 in /srv/tp/venv/build/pandas

Exception information:
Traceback (most recent call last):
  File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
    requirement_set.install(install_options, global_options)
  File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1133, in install
    requirement.install(install_options, global_options)
  File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 577, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 256, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /srv/tp/venv/bin/python -c "import setuptools;__file__='/srv/tp/venv/build/pandas/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-0bOHrG-record/install-record.txt --install-headers /srv/tp/venv/include/site/python2.7 failed with error code 1 in /srv/tp/venv/build/pandas

我在ubuntu上遇到了同样的问题和错误,然后创建了一个交换文件,它就解决了! 可以在下面的链接中找到教程,但简而言之:

sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

创建交换文件后,我重新启动了服务器,键入了pip install pandas ,它终于工作了。

最安全的方法就是:sudo apt-get install python-pandas

可能是内存不足错误。 在你的日志顶部,我可以看到gcc退出,代码错误4.当我google它时,我看到了一个stackoverflow线程: 在virtualenv Ubuntu 12.10中安装带有pip的lxml错误:命令'gcc'失败,退出状态为4

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM