【发布时间】:2015-09-15 13:30:07
【问题描述】:
我从官方网站编译了uwsgi版本x.y.zz.ww,我使用官方文档建议的命令编译了uwsgi
然后我用官方文档中的命令编译了Python建议的插件,我得到的错误输出是这样的:
>ubuntu@ip-xx-yy-zz-ww:~/tmp/uwsgi-xx.yy.zz.ww$ PYTHON=python3.4 ./uwsgi --build-plugin "plugins/python python34"
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python34_plugin.so
/usr/bin/ld: /usr/local/lib/python3.4/config-3.4m/libpython3.4m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python3.4/config-3.4m/libpython3.4m.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
*** unable to build python34 plugin ***
使用 uwsgi 而不从源代码编译它的替代方法是使用 pip3 install uwsgi,在这种情况下,插件在文件夹 plugins/python/python_plugin.o 中编译但找不到它.我在项目中使用virtualenv,编译的插件必须在根目录下还是在lib文件夹的virtualenv环境中?
【问题讨论】:
-
您使用的是哪个版本的 ubuntu?如果是 14.04,您可以直接使用
apt-get install uwsgi-plugin-python3并将plugin=python3作为属性放在您的应用程序配置文件中。