Python编译错误:“平台的LONG_BIT定义似乎错误"; [英] Python compilation error: "LONG_BIT definition appears wrong for platform"

查看:990
本文介绍了Python编译错误:“平台的LONG_BIT定义似乎错误";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This error message is not unknown, I have already reinstalled many packages, but so far not yet found a solution.

我从命令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?)."

^

在长时间的追溯结束时,它说:

At the end of a long traceback it says:

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.

python-dev, python2.7-dev and python3-dev exist.

推荐答案

确保为python安装了正确的位. 就我而言,我在64位centOs上安装了32位anaconda python,这引起了问题.为Python安装正确的位版本可以解决该问题.

Make sure you have the right bits-installed for python. In my case I installed anaconda python 32-bit on my 64-bit centOs which caused the issue. Installing the right bit version for Python fixed it.

这篇关于Python编译错误:“平台的LONG_BIT定义似乎错误";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆