开发者

uWSGI libxml2 headers unavailable

开发者 https://www.devze.com 2023-03-18 08:18 出处:网络
Every now and again a problem comes up that just seems it shouldn\'t have to be this exasperating. Or else I\'m missing something simple (perhaps more likely).

Every now and again a problem comes up that just seems it shouldn't have to be this exasperating. Or else I'm missing something simple (perhaps more likely).

I'm on a CentOS box trying to get uWSGI installed & configured to host a django site. I'm using python2.7 installed @ /opt/python2.7/lib/python2.7.

Ran: pip install http://projects.unbit.it/downloads/uwsgi-latest.tar.gz

Got:* libxml2 headers unavailable. uWSGI build is interrupted. You have to install libxml2 development package or use libexpat or disable XML

So I thought this would be easy.

Ran: yum install libxml2

Got: Package libxml2 - 2.6.26-2.1.2.8.el5_5.1.i386 is already installed.

Sure enough, I can import开发者_StackOverflow中文版 libxml2 in python2.4. But not python2.7. Since then I've been googling ad infinitum for an answer. Seems 10,000 people have similar difficulties getting uWSGI installed because of the XML library issue, but I need to install it twice.

So I tried to compile from source:

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz

tar xzvf libxml2-2.7.3.tar.gz

cd libxml2-2.7.3

./configure --prefix=/usr/local

make

make install

(run python2.7)

import libxml2

ImportError: No module named libxml2

What did I do to deserve this? Can't win, it seems. What should I try next?


yum install libxml2-devel

libxml2 is a c library there is no way to load it from python without a binding.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号