为什么我的numpy安装会被杀死?

时间:2016-06-05 15:13:48

标签: python numpy virtualenv

这是我在Coding Ground上尝试做的事情

sh-4.3$ pip install --target=. virtualenv
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting virtualenv
  Downloading virtualenv-15.0.2-py2.py3-none-any.whl (1.8MB)
    100% |################################| 1.8MB 204kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv
sh-4.3$ python virtualenv.py mine
New python executable in /home/cg/root/mine/bin/python
Installing setuptools, pip, wheel...done.
sh-4.3$ . mine/bin/activate
(mine) sh-4.3$ pip install numpy
Collecting numpy
  Downloading numpy-1.11.0-cp27-cp27mu-manylinux1_x86_64.whl (15.3MB)
    99% |############################### | 15.3MB 43.1MB/s eta 0:00:01Killed
(mine) sh-4.3$

为什么我尝试安装numpy会被杀死? 我该如何解决这个问题?

1 个答案:

答案 0 :(得分:4)

快速解决此问题的方法是添加交换内存。这是一个Ubuntu示例:

sudo mkdir /media/fasthdd
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=1024 count=1M
sudo mkswap /media/fasthdd/swapfile.img
sudo swapon /media/fasthdd/swapfile.img

如果您不需要,请不要忘记将其关闭。