繁体   English   中英

在amazon ec2上的python34中安装lxml

[英]installing lxml in python34 on amazon ec2

我在这个主题上看过很多线程,但我仍然无法在Amazon EC2上的python34中安装lxml模块。

我已经安装了请求模块

sudo easy_install-3.4 requests

但是,如果我尝试安装lxml模块

sudo easy_install-3.4 lxml

它失败了,我得到了

Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.6.0
Downloading https://pypi.python.org/packages/11/1b/fe6904151b37a0d6da6e60c13583945f8ce3eae8ebd0ec763ce546358947/lxml-3.6.0.tar.gz#md5=5957cc384bd6e83934be35c057ec03b6
Processing lxml-3.6.0.tar.gz
Writing /tmp/easy_install-i92lmsc5/lxml-3.6.0/setup.cfg
Running lxml-3.6.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-i92lmsc5/lxml-3.6.0/egg-dist-tmp-km_e4sdc
Building lxml version 3.6.0.
Building without Cython.
Using build configuration of libxslt 1.1.28
Building against libxml2/libxslt in the following directory: /usr/lib64
unable to execute 'gcc': No such file or directory
Compile failed: command 'gcc' failed with exit status 1
unable to execute 'cc': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: Setup script exited with error: command 'gcc' failed with exit status 1

那么我尝试用以下命令安装libxml2:

sudo yum install libxml2-devel libxslt-devel python-devel

我明白了

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest                                                                                                                      | 2.1 kB     00:00
amzn-updates/latest                                                                                                                   | 2.3 kB     00:00
Package libxml2-devel-2.9.1-6.2.50.amzn1.x86_64 already installed and latest version
Package libxslt-devel-1.1.28-5.12.amzn1.x86_64 already installed and latest version
Package python26-devel-2.6.9-2.84.amzn1.x86_64 already installed and latest version
Nothing to do

那么如果已经安装了libxml2模块,问题出在哪里呢?

根据以下错误消息,它看起来不像您安装了编译器。

/usr/lib64 unable to execute 'gcc': No such file or directory

除了开发库之外,您还需要安装编译器。

sudo yum install gcc libxml2-devel libxslt-devel python-devel
sudo easy_install-3.4 lxml

暂无
暂无

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

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