麻烦在Amazon EC2上的Linux微实例的virtualenv安装SciPy的 [英] Trouble installing scipy in virtualenv on a amazon ec2 linux micro instance

查看:652
本文介绍了麻烦在Amazon EC2上的Linux微实例的virtualenv安装SciPy的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装了 SciPy的在默认的Python编译器在Amazon EC2微实例(Ubuntu的13.04)。但是我不能够安装 SciPy的中的virtualenv。

PIP安装SciPy的这个错误结束

  SciPy的/疏/ sparsetools / csr_wrap.cxx:在函数'无效init_csr():

SciPy的/疏/ sparsetools / csr_wrap.cxx:73303:21:警告:变量MD设置,但不使用[-Wunused,但是设置变量]

C ++:内部编译器错误:杀(程序cc1plus)

请提交一份完整的错误报告,

其中preprocessed来源,如果合适。

见<文件:///usr/share/doc/gcc-4.7/README.Bugs>的说明。

----------------------------------------
清理...
命令的/ home / Ubuntu的/ PNR /斌/ Python的-c进口setuptools;__file__='/home/ubuntu/pnr/build/scipy/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\ N'),__FILE__,'EXEC'))安装--record /tmp/pip-t8Drvd-record/install-record.txt --single-版本外部管理--install-头/家用/ Ubuntu的/pnr/include/site/python2.7失败,错误code -9在/ home / Ubuntu的/ PNR /建设/ SciPy的
 

 回溯(最近通话最后一个):
  文件/家/ Ubuntu的/ PNR /斌/点子,9号线,与<模块>
    load_entry_point('点子== 1.4.1,console_scripts','点子')()
  文件/home/ubuntu/pnr/local/lib/python2.7/site-packages/pip/__init__.py,线路148,主
    返回command.main(参数[1:]选项)
  文件/home/ubuntu/pnr/local/lib/python2.7/site-packages/pip/basecommand.py,线路169,主
    文='\ n'.join(complete_log)
统一codeDE codeError:ASCIIcodeC可以在位置53没有去code字节0xe2:顺序不在范围内(128)
 

在有人问。 PIP冻结为默认的编译器返回

 猎豹== 2.4.4
景观客户端== 12.12
M2Crypto == 0.21.1
PAM == 0.4.2
枕头== 2.0.0
PyYAML == 3.10
扭曲的核心== 12.3.0
双绞线名称== 12.3.0
双绞线网络== 12.3.0
易-的Xapian指数== 0.45
argparse == 1.2.1
博托== 2.3.0
chardet的== 2.0.1
云初始化== 0.7.2
configobj == 4.7.2
分发== 0.6.34
发行-信息== 0.10
euca2ools == 2.1.1
numpy的== 1.7.1
OAuth的== 1.0.1
的paramiko == 1.7.7.1
prettytable == 0.6.1
pyOpenSSL == 0.13
pycrypto == 2.6
pycurl == 7.19.0
pygobject == 3.8.0
pyserial == 2.6
蟒蛇,容易== 0.8.8ubuntu6
蟒蛇-debian的== 0.1.21-nmu2ubuntu1
请求== 1.1.0
SciPy的== 0.11.0
6 == 1.2.0
SSH-进口ID == 3.14
urllib3 == 1.5
的virtualenv == 1.10.1
==的wsgiref 0.1.2
zope.interface == 4.0.5
 

PIP冻结命令的virtualenv返回

 用Cython == 0.19.2
瓶== 0.10.1
烧瓶引导== 3.0.0.1
烧瓶跆拳道== 0.9.3
Jinja2的== 2.7.1
MarkupSafe == 0.18
WTForms == 1.0.5
WERKZEUG == 0.9.4
argparse == 1.2.1
beautifulsoup4 == 4.3.2
itsdangerous == 0.23
numpy的== 1.7.1
pymongo == 2.6.2
请求== 2.0.0
==的wsgiref 0.1.2
 

解决方案

一个解决方案是临时启用掉在你的微实例。截至本 SO帖子,使1GB交换通过:

 须藤/斌/ DD如果=的/ var / swap.1 BS = 1M的=的/ dev /零数= 1024
须藤/ sbin目录/再用mkswap /var/swap.1
须藤/ sbin目录/ swapon命令/var/swap.1
 

在交换上,通过安装PIP SciPy的:

 命令和apt-get安装-y libatlas基-dev的gfortran蟒蛇-dev的建立必要的G ++
须藤PIP安装numpy的
须藤PIP安装SciPy的
 

在SciPy的成功安装,您可以通过禁用它:

 须藤的swapoff /var/swap.1
sudo的RM /var/swap.1
 

I have successfully installed scipy in the default python compiler on an amazon ec2 micro instance (Ubuntu 13.04). However i am not able to install scipy in a virtualenv.

pip install scipy ends with this error

scipy/sparse/sparsetools/csr_wrap.cxx: In function ‘void init_csr()’:

scipy/sparse/sparsetools/csr_wrap.cxx:73303:21: warning: variable ‘md’ set but not used [-Wunused-but-set-variable]

c++: internal compiler error: Killed (program cc1plus)

Please submit a full bug report,

with preprocessed source if appropriate.

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

----------------------------------------
Cleaning up...
Command /home/ubuntu/pnr/bin/python -c "import setuptools;__file__='/home/ubuntu/pnr/build/scipy/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-t8Drvd-record/install-record.txt --single-version-externally-managed --install-headers /home/ubuntu/pnr/include/site/python2.7 failed with error code -9 in /home/ubuntu/pnr/build/scipy

and

Traceback (most recent call last):
  File "/home/ubuntu/pnr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/home/ubuntu/pnr/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
    return command.main(args[1:], options)
  File "/home/ubuntu/pnr/local/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 53: ordinal not in range(128)

Before anyone asks. pip freeze for default compiler returns

Cheetah==2.4.4
Landscape-Client==12.12
M2Crypto==0.21.1
PAM==0.4.2
Pillow==2.0.0
PyYAML==3.10
Twisted-Core==12.3.0
Twisted-Names==12.3.0
Twisted-Web==12.3.0
apt-xapian-index==0.45
argparse==1.2.1
boto==2.3.0
chardet==2.0.1
cloud-init==0.7.2
configobj==4.7.2
distribute==0.6.34
distro-info==0.10
euca2ools==2.1.1
numpy==1.7.1
oauth==1.0.1
paramiko==1.7.7.1
prettytable==0.6.1
pyOpenSSL==0.13
pycrypto==2.6
pycurl==7.19.0
pygobject==3.8.0
pyserial==2.6
python-apt==0.8.8ubuntu6
python-debian==0.1.21-nmu2ubuntu1
requests==1.1.0
scipy==0.11.0
six==1.2.0
ssh-import-id==3.14
urllib3==1.5
virtualenv==1.10.1
wsgiref==0.1.2
zope.interface==4.0.5

pip freeze command for virtualenv returns

Cython==0.19.2
Flask==0.10.1
Flask-Bootstrap==3.0.0.1
Flask-WTF==0.9.3
Jinja2==2.7.1
MarkupSafe==0.18
WTForms==1.0.5
Werkzeug==0.9.4
argparse==1.2.1
beautifulsoup4==4.3.2
itsdangerous==0.23
numpy==1.7.1
pymongo==2.6.2
requests==2.0.0
wsgiref==0.1.2

解决方案

One solution is to temporarily enable swap on your micro instance. As described at this SO post, enable 1gb swap via:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1

Once swap is on, install scipy via pip:

sudo apt-get install -y libatlas-base-dev gfortran python-dev build-essential g++
sudo pip install numpy
sudo pip install scipy

Once scipy successfully installs, you can disable it via:

sudo swapoff /var/swap.1
sudo rm /var/swap.1

这篇关于麻烦在Amazon EC2上的Linux微实例的virtualenv安装SciPy的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆