简体   繁体   中英

Compiling a Python binding on Linux

I'm trying to compile a Python binding, but I'm unable to find the python.h header on debian. Which package should I install?

你应该安装python-dev

需要安装python-dev软件包。

First of all, the header file for embedding or extending python is Python.h , with an uppercase P. Linux is case sensitive, and python.h won't work.

On debian and debian deriviatives like ubuntu, you can use apt-file to find out what package to install, given a filename:

$ apt-file search Python.h
...
python2.6-dbg: /usr/include/python2.6_d/Python.h
python2.6-dev: /usr/include/python2.6/Python.h
...
sudo apt-get install python2.6-dev 

or

sudo apt-get install python2.7-dev 

According to virtualenv option

You are missing the development header. try

sudo apt-get install python-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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