【问题标题】:Installation of Pandas fails on Ubuntu 12.04在 Ubuntu 12.04 上安装 Pandas 失败
【发布时间】:2014-01-12 13:33:33
【问题描述】:

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

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

我看到其他参考资料(没有相同的错误)暗示内存可能是一个问题;远程服务器(Digital Ocean droplet)只有 512MB。

pip 错误日志的尾部如下图所示:

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

【问题讨论】:

    标签: python ubuntu pandas installation


    【解决方案1】:

    我在 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,它终于工作了。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        【解决方案3】:

        可能是内存不足错误。在你的日志顶部,我可以看到 gcc exit with code error 4。当我用谷歌搜索它时,我看到了一个 stackoverflow 线程:Installing lxml with pip in virtualenv Ubuntu 12.10 error: command 'gcc' failed with exit status 4

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-08-01
          • 2014-08-12
          • 2012-12-10
          • 2013-07-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多