Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 views
in Technique[技术] by (71.8m points)

header files - What is python-dev package used for

I recently installed lxml.

Before that, I had to install all the dependencies for that. So I tried to install liblxml2-dev, liblxslt1-dev and python-dev (google-searched for what packages are required for lxml) but even after that, I could not able to install lxml by using the command pip install lxml.

However as because I am using Python 3.4.0, I thought that may be there are different version of python-dev (thought came due to facing some similar version conflict problem). So I tried to install python3-dev.

Then I tried to install lxml using the same command said earlier and that worked!!!

I google-searched for those sentences and I could able to understand the meaning of lxml and xslt. I found a link for python-dev but I am not still sure what it is actually doing.

OS - Ubuntu

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

python-dev

python-dev contains the header files you need to build Python extensions.

lxml

lxml is a Python C-API extension that is compiled when you do pip install lxml. The lxml sources have at least something like #include <Python.h> in the code. The compiler looks for the header file Python.h during compilation, hence those header files need to be on your system such that they can be found.

-dev packages on Linux

On Linux typically, the binary libraries and header files of packages like Python are separate. Hence you can have Python (e.g. package python) installed and everything works fine. But when you want to build extensions you need to install the corresponding -dev package.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...