【发布时间】:2017-08-31 07:13:09
【问题描述】:
这个错误信息不是未知的,我已经重新安装了很多包,但目前还没有找到解决办法。
我从命令pip install cryptography得到以下错误
/usr/include/python2.7/pyport.h:849:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
^
在长回溯结束时它说:
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xXOpFq-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log
存在python-dev、python2.7-dev和python3-dev。
【问题讨论】:
-
请使用有意义的标题。你的说(从 gobbledygook 翻译)“有一个编译错误”。
-
关于问题本身,您需要跟踪
LONG_BIT和SIZEOF_LONG的定义位置。应该很迷人。对于 64 位系统,LONG_BIT应该是 64,SIZEOF_LONG和sizeof(long)应该是 8。LONG_BIT应该依赖于limits.h中的LONG_MAX,并且SIZEOF_LONG应该在pyconfig.h中定义。 -
"python3-dev exists" :除非使用
pip3命令,否则不相关。 ...您的操作系统未知。可能是 Ubuntu 15.10 吗?不能是 Debian 8:cryptography已与python-all-dev一起安装。 ...刚刚使用五个不同的操作系统运行pip install cryptography安装测试:完全没有问题。 ... -
在 /usr/include/python2.7/pyconfig.h 中定义为
SIZEOF_LONG 4。但是在 /usr/include/x86_64-linux-gnu/python2.7/pyconfig.h 中定义了SIZEOF_LONG 8。