gpt4 book ai didi

python - 错误 : Command failed with rc=65536 python and mod_wsgi

转载 作者:太空宇宙 更新时间:2023-11-03 13:49:56 25 4
gpt4 key购买 nike

我遇到了这个问题:

我正在运行 pythonbrew 以获得 python2.7,因此我重新编译了 mod_wsgi 以使用 2.7 python。

为此,我遵循了本教程:

code.google.com/p/modwsgi/wiki/QuickInstallationGuide

这涉及到下载文件 - 我得到了一个 tar.gz 文件 - 然后使用 ./configure --with-python=/home/bharal/.pythonbrew/pythons/Python-“配置它” 2.7.2/bin/python --启用共享

现在我假设这是为我的 python 附加的正确位置 - 上面的 with-python 的值只是我对 which python

的响应

好的!所以,现在的问题。在我运行上面的配置之后,我运行 make 并且我得到:

/usr/include/features.h:160:1: warning: this is the location of the previous definition
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static x86_64-linux-gnu-gcc -o mod_wsgi.la -rpath /usr/lib/apache2/modules -module -avoid-version mod_wsgi.lo -L/home/aiyer /.pythonbrew/pythons/Python-2.7.2/lib -L/home/aiyer/.pythonbrew/pythons/Python-2.7.2/lib /python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm
/usr/bin/ld: /home/bharal/.pythonbrew/pythons/Python-2.7.2/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/home/aiyer/.pythonbrew/pythons/Python-2.7.2/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

我不知道该怎么办。我发现这个答案是这样的:

https://stackoverflow.com/a/6118155/1061426

但这对我没有太大帮助 - 就我所能讲述的一系列步骤而言,这还不够,但更值得思考的是一个有趣的花絮。

我运行这个命令来检查我是否有 python 64 位:

import sys
print maxint

如果是 64 位 ==> 9223372036854775807如果 32 位 ==> 2147483647

好的,所以我正在运行 64 位,因为我得到了更大的数字。所以我在这里读了这个 doco:

http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bit_And_64_Bit_Packages

因为我正在运行 64 位 python,这是否意味着我的问题不是这个:

This error is believed to be result of the version of Python being used having been originally compiled for the generic X86 32 bit architecture whereas mod_wsgi is being compiled for X86 64 bit architecture. The actual error arises in this case because 'libtool' would appear to be unable to generate a dynamically loadable module for the X86 64 bit architecture from a X86 32 bit static library.

而是这个?

Alternatively, the problem is due to 'libtool' on this platform not being able to create a loadable module from a X86 64 bit static library in all cases.

(以上引用自以上链接)

如果是这种情况,我到底该怎么办?我完全不知道在任一种情况下该怎么做 - 是的,我阅读了该页面的其余部分,但它也可能是用希腊语写的(我不会说希腊语) .

有什么建议吗?

更新:我从来没有解决这个问题,最终使用了我的 ubuntu 附带的 python - 与我的代码运行的观点没有区别。

最佳答案

文档说:

If the first issue, the only solution to this problem is to recompile Python for the X86 64 bit architecture. When doing this, it is preferable, and may actually be necessary, to ensure that the '--enable-shared' option is provided to the 'configure' script for Python when it is being compiled and installed.

因此,您需要从源代码重新安装 Python,确保在运行“make”之前将“--enable-shared”选项提供给 Python 的“configure”命令。

如果“pythonbrew”不允许您这样做,那么请告诉 pythonbrew 人员,他们构建带有共享库支持的 Python 版本的方式可以说是错误的,并且会阻止许多嵌入式系统无法运行。

关于python - 错误 : Command failed with rc=65536 python and mod_wsgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11332717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com