在virtualenv中编译mod_wsgi时出现问题 [英] Problems compiling mod_wsgi in virtualenv
问题描述
我试图在CentOS服务器上编译mod_wsgi(版本3.3),Python 2.6-但在virtualenv
下,没有成功.我遇到了错误:
I'm trying to compile mod_wsgi (version 3.3), Python 2.6, on a CentOS server - but under virtualenv
, with no success. I'm getting the error:
/usr/bin/ld: /home/python26/lib/libpython2.6.a(node.o): 针对`a重定位R_X86_64_32 本地符号"在以下情况下不能使用 制作共享对象;重新编译 -fPIC
/usr/bin/ld: /home/python26/lib/libpython2.6.a(node.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/python26/lib/libpython2.6.a: 无法读取符号:值错误
/home/python26/lib/libpython2.6.a: could not read symbols: Bad value
根据 mod_wsgi安装问题文档,可能是 libpython2.6 .a 文件:
- 不在那里
- 不是与共享 一起生成的
- 是为32位计算机而不是64位计算机生成的.
- isn't there
- wasn't generated with shared
- was generated for a 32-bit machine, not 64-bit.
好吧,该文件在正确的位置并且可读.我尝试使用--enable-shared
选项重新编译Python 2.6,但是整个编译都崩溃了,几乎每个文件都给出了相同的错误, libpython2.6.a 是软管.
Well, the file is in the right place, and readable. I tried to recompile Python 2.6 with the --enable-shared
option, but the entire compilation blew up, with roughly every file giving the same error, that libpython2.6.a was hosed.
我不知道 Python正在针对64位进行编译,但是当我运行它并做到了:
I don't know that Python was compiling for 64-bit, but when I ran it, and did:
import platform
print platform.platform()
>>>Linux-2.6.18-028stab070.4-x86_64-with-redhat-5.6-Final
由于Python认为它是在x86_64上,因此我希望它编译为64位-如果有人可以确认这一点,我将不胜感激.
Since Python thinks it's on a x86_64, I would hope that it compiled for 64-bit - if anyone has any way of confirming that, I'd appreciate it.
我尝试配置带有和不带有--python =/home/[...]/python2.6的mod_wsgi Makefile,两种方法都被炸毁.
I tried configuring the mod_wsgi Makefile with both with and without --python=/home/[...]/python2.6, both ways blew up.
我还尝试使用Python 2.4编译virtualenv
的mod_wsgi .不幸的是,如果我要使用virtualenv
:)
I also tried compiling mod_wsgi outside of virtualenv
, using Python 2.4, and it worked fine. Unfortunately, that doesn't help me if I'm going to be using virtualenv
:)
任何人都知道如何让mod_wsgi在virtualenv
下编译吗?
Anyone know how I can get mod_wsgi to compile under virtualenv
?
推荐答案
文档的相关部分是:
This mentions the -fPIC problem.
并且:
这里提到当mod_wsgi无法找到共享库时,需要使用LD_RUN_PATH.
This mentions need to use LD_RUN_PATH when shared library can't be found by mod_wsgi.
可以在以下位置找到有关共享库问题以及mod_wsgi查找错误的Python安装问题的其他信息:
Additional information can be found about shared library issues as well as problems with mod_wsgi finding wrong Python installation at:
这篇关于在virtualenv中编译mod_wsgi时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!