Python编译错误:" LONG_BIT定义对于平台来说是错误的"

时间:2015-11-16 21:42:03

标签: python linux ubuntu gcc

此错误消息未知,我已经重新安装了许多软件包,但到目前为止尚未找到解决方案。

我从命令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存在。

1 个答案:

答案 0 :(得分:1)

确保为python安装了正确的位。 在我的情况下,我在我的64位centOs上安装了32位的anaconda python导致了这个问题。为Python安装正确的位版本修复了它。