Python uWSGI无法在Ubuntu18.04上从pip构建
试图从命令行安装uWSGIPython uWSGI无法在Ubuntu18.04上从pip构建,python,ubuntu,pip,uwsgi,Python,Ubuntu,Pip,Uwsgi,试图从命令行安装uWSGI pip install uwsgi 导致长堆栈跟踪,以下是其结尾: /usr/bin/x86_64-linux-gnu-ld: /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a(parser.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object;
pip install uwsgi
导致长堆栈跟踪,以下是其结尾:
/usr/bin/x86_64-linux-gnu-ld: /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a(parser.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
*** error linking uWSGI ***
----------------------------------------
Command "/home/user/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ve0nx9k8/uwsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-l_7f937a/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/venv/include/site/python3.6/uwsgi" failed with error code 1 in /tmp/pip-install-ve0nx9k8/uwsgi/
我正在使用Python 3.6。Python2可以工作,Python3.7可以工作,但不幸的是,我需要使用Python3.6。虚拟环境中没有其他东西,这是一次全新的ubuntu重新安装。我在尝试使用python系统构建时遇到了这个错误。当我切换到并安装自定义python版本时,uWSGI安装得很好。错误意味着链接器想要构建一个独立的可执行(饼图对象),但是它不能,因为libpython3.6m.a库是在不支持这种链接的情况下构建的 我在使用通过
pyenv
安装的Python时遇到了这个问题
要解决此问题,请使用特殊编译器标志重新安装Python:
CONFIGURE_OPTS=--enable-shared pyenv install 3.7.7 # use your Python version
这在他们的报告中提到过,但对我来说,还不清楚何时需要这样的标志。我发现了这一点,在venv中似乎没有解决方案@leech,你想安装哪个uWSGI版本?