python,pyenv和重新编译以处理64位问题? [英] python, pyenv and recompiling to handle a 64bit issue?
问题描述
我有pyenv,我想针对apache使用python 3.4.1.
I have pyenv, and i want to use python 3.4.1 against apache.
为此,我已经安装了mod_wsgi 4.2.7
To that end, I have installed mod_wsgi 4.2.7
在编译mod_wsgi时,出现以下错误:
In compiling mod_wsgi, I get the following error:
Object_NextNotImplemented' can not be used when making a shared object; recompile with -fPIC
/root/.pyenv/versions/3.4.1/lib/libpython3.4m.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [src/server/mod_wsgi.la] Error 1
根据此页面,此问题与64位或32位或...我不知道.
According to this page the issue is something to do with a 64bit or a 32 bit or... I don't know.
无论如何,解决方案是使用某种标志重新编译python.
Anyway, the solution is to re-compile python with some sort of flag.
在考虑使用pyenv的情况下,如何解决此问题?
How do i resolve this issue, bearing in mind that i am using pyenv?
推荐答案
这不是解决方案,完成此操作后我仍然遇到相同的错误
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4 --enable-shared"
pyenv uninstall 3.4.1
pyenv install 3.4.1
所以第一行-我认为实际上没有用,我不知道它在做什么.我想这只是在某个地方设置一些魔术系统变量?哦,是这样的.
so the first line - i didn't think would actually work, I don't know what it is doing. I guess it is just setting some magic system variable somewhere? Oh well, it is doing that.
我不知道unicode位的作用-都建议使用在此链接此处.
I don't know what the unicode bit does - this was all suggested in this link here.
因为我要使用python 3.4.1,并且因为它已经存在,所以我然后卸载了python 3.4.1
Becuase i am wanting to use python 3.4.1, and because it already exists, i then uninstall python 3.4.1
然后我重新安装python 3.4.1
Then i reinstall python 3.4.1
如果您想对python x.y.z做同样的事情,您同样会拥有
If you wanted to do the same with python x.y.z, you would similarly have
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4 --enable-shared"
pyenv uninstall x.y.z
pyenv install x.y.z
如果您以前没有安装x.y.z python,嗯,那么就不需要卸载它.
If you had not installed x.y.z python earlier, um, then you wouldn't need to uninstall it.
整个安装过程需要一段时间.我从开始install
命令开始就写这个答案,而且直到最近才完成.
This whole installation process takes... a while. I started writing this answer right after i kicked off the install
command, and it only recently finished.
完成后我会得到
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
Installed Python-3.4.1 to /root/.pyenv/versions/3.4.1
但是我不知道这是好是坏.提示本身似乎也不知道,所有这些问号旁边都有什么.
But i don't know if that is bad or good. The prompt itself doesn't seem to know either, what with all those question marks around.
这篇关于python,pyenv和重新编译以处理64位问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!