uWSGI libxml2 标头不可用
时不时地会出现一个问题,但似乎不应该如此令人恼火。否则我会错过一些简单的东西(也许更有可能)。
我在 CentOS 机器上尝试安装 uWSGI &配置为托管 django 站点。我使用的是安装在@/opt/python2.7/lib/python2.7 的python2.7。
运行: pip install http://projects.unbit.it/downloads/uwsgi-latest .tar.gz
得到:* libxml2 标头不可用。 uWSGI构建被中断。你必须安装 libxml2 开发包或使用 libexpat 或禁用 XML
所以我认为这很容易。
跑: yum install libxml2
得到: 软件包 libxml2 - 2.6.26-2.1.2.8.el5_5.1.i386 已安装。
果然,我可以在python2.4中导入libxml2了。但不是python2.7。从那时起,我就一直在谷歌上无休止地寻找答案。由于 XML 库问题,似乎有 10,000 人在安装 uWSGI 时遇到类似的困难,但我需要安装它两次。
所以我尝试从源代码进行编译:
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
我做了什么才配得上这个?看来是赢不了了接下来我应该尝试什么?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
yum install libxml2-devel
libxml2 是 ac 库,没有绑定就无法从 python 加载它。
yum install libxml2-devel
libxml2 is a c library there is no way to load it from python without a binding.