Linux 如何安装python开发包?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6230444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install python developer package?
提问by David
I am trying to get mod_wsgi 3.3
to work. When I run make
it is telling me that I am missing the Python developer package. How do I get and install the Python developer package?
我正在努力mod_wsgi 3.3
上班。当我运行时,make
它告诉我我缺少 Python 开发人员包。如何获取和安装 Python 开发包?
The error I get is as follows:
我得到的错误如下:
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
System (Amazon EC2 instance)
系统(Amazon EC2 实例)
- Apache 2.2.16 (Unix)
- Amazon Linux(Red Hat 4.4.4-13) AMI Beta Version 2011.02
- Python 2.6.6
- Apache 2.2.16 (Unix)
- Amazon Linux(Red Hat 4.4.4-13) AMI Beta 版 2011.02
- 蟒蛇 2.6.6
采纳答案by David
yum install python-devel
will work.
yum install python-devel
将工作。
If yum
doesn't work then use
如果yum
不起作用,则使用
apt-get install python-dev
apt-get install python-dev
回答by Datalker
For me none of the packages mentioned above did help.
对我来说,上面提到的软件包都没有帮助。
I finally managed to install lxml
after running:
lxml
运行后我终于设法安装了:
sudo apt-get install python3.5-dev
回答by ben jarman
If you use yum search you can find the python dev package for your version of python.
如果您使用 yum 搜索,您可以找到适用于您的 Python 版本的 Python 开发包。
For me I was using python 3.5. I ran the following
对我来说,我使用的是 python 3.5。我跑了以下
yum search python | grep devel
Which returned the following
返回以下内容
I was then able to install the correct package for my version of python with the following cmd.
然后,我能够使用以下 cmd 为我的 python 版本安装正确的包。
sudo yum install python35u-devel.x86_64
This works on centos for ubuntu or debian you would need to use apt-get
这适用于 ubuntu 或 debian 的 centos,您需要使用 apt-get