如何安装python开发包?

时间:2011-06-03 17:18:58

标签: python linux amazon-ec2 mod-wsgi

我想让mod_wsgi 3.3工作。当我运行make时,它告诉我我缺少Python开发人员包。如何获取并安装Python开发人员包?

我得到的错误如下:

mod_wsgi.c:135:20: error: Python.h: No such file or directory
mod_wsgi.c:138:2: error: #error Sorry, Python developer package does not appear to be installed.
mod_wsgi.c:142:2: error: #error Sorry, mod_wsgi requires at least Python 2.3.0 for Python 2.X.
mod_wsgi.c:150:2: error: #error Sorry, mod_wsgi requires that Python supporting thread.
mod_wsgi.c:153:21: error: compile.h: No such file or directory
mod_wsgi.c:154:18: error: node.h: No such file or directory
mod_wsgi.c:155:20: error: osdefs.h: No such file or directory

系统(Amazon EC2实例)

  • Apache 2.2.16(Unix)
  • Amazon Linux(Red Hat 4.4.4-13)AMI Beta版本2011.02
  • Python 2.6.6

3 个答案:

答案 0 :(得分:67)

yum install python-devel将有效。

如果yum不起作用,请使用

apt-get install python-dev

答案 1 :(得分:7)

如果你使用yum搜索,你可以找到你的python版本的python开发包。

对我来说,我使用的是python 3.5。我运行了以下

{{1}}

返回以下内容

enter image description here

然后我可以使用以下cmd为我的python版本安装正确的包。

{{1}}

这适用于ubuntu或debian的centos,你需要使用apt-get

答案 2 :(得分:6)

对我来说,上面提到的包裹都没有帮助。

我在运行后终于设法安装了lxml

sudo apt-get install python3.5-dev