src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录
2023-09-11 14:16:20 时间
一、前言
在CentOS 上安装fabric时出现问题,首先已安装pip, 用pip执行以下命令pip install
出现以下问题
- [niy@niy-computer /]$ sudo pip install fabric
- Requirement already satisfied (use --upgrade to upgrade): fabric in /usr/lib/python2.6/site-packages/Fabric-1.3.1-py2.6.egg
- Requirement already satisfied (use --upgrade to upgrade): ssh>=1.7.8 in /usr/lib/python2.6/site-packages/ssh-1.8.0-py2.6.egg (from fabric)
- Downloading/unpacking pycrypto>=2.1,!=2.4 (from ssh>=1.7.8->fabric)
- Running setup.py egg_info for package pycrypto
- Installing collected packages: pycrypto
- Found existing installation: pycrypto 2.0.1
- Uninstalling pycrypto:
- Successfully uninstalled pycrypto
- Running setup.py install for pycrypto
- warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
- building 'Crypto.Hash._MD2' extension
- gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD2.c -o build/temp.linux-i686-2.6/src/MD2.o
- src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录
- src/MD2.c:131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- In file included from src/MD2.c:147:
- src/hash_template.c:48: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’
- src/hash_template.c:59: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’
- src/hash_template.c: 在函数‘newALGobject’中:
- src/hash_template.c:69: 警告:隐式声明函数‘PyObject_New’
- src/hash_template.c:69: 错误:expected expression before ‘ALGobject’
- src/hash_template.c: 在文件层:
- src/hash_template.c:76: 错误:expected ‘)’ before ‘*’ token
- src/hash_template.c:91: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:110: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:122: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:162: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:188: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:190: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’
- src/hash_template.c:199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:225: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’
- src/hash_template.c:271: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:304: 错误:数组元素的类型不完全
- src/hash_template.c:305: 错误:‘PyCFunction’未声明(不在函数内)
- src/hash_template.c:305: 错误:expected ‘}’ before ‘ALG_new’
- src/hash_template.c: 在函数‘init_MD2’中:
- src/hash_template.c:339: 错误:‘PyObject’未声明(在此函数内第一次使用)
- src/hash_template.c:339: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
- src/hash_template.c:339: 错误:所在的函数内也只报告一次。)
- src/hash_template.c:339: 错误:‘m’未声明(在此函数内第一次使用)
- src/hash_template.c:351: 错误:‘ALGtype’未声明(在此函数内第一次使用)
- src/hash_template.c:351: 错误:‘PyType_Type’未声明(在此函数内第一次使用)
- src/hash_template.c:352: 警告:隐式声明函数‘Py_InitModule’
- src/hash_template.c:356: 错误:‘o’未声明(在此函数内第一次使用)
- src/hash_template.c:356: 警告:隐式声明函数‘PyInt_FromLong’
- src/hash_template.c:356: 警告:隐式声明函数‘PyDict_SetItemString’
- src/hash_template.c:356: 警告:隐式声明函数‘PyModule_GetDict’
- src/hash_template.c:356: 警告:隐式声明函数‘Py_DECREF’
- src/hash_template.c:360: 警告:隐式声明函数‘PyErr_Occurred’
- src/hash_template.c:361: 警告:隐式声明函数‘Py_FatalError’
- error: command 'gcc' failed with exit status 1
- Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ai6cQR-record/install-record.txt --single-version-externally-managed:
- running install
- running build
- running build_py
- running build_ext
- running build_configure
- warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
- building 'Crypto.Hash._MD2' extension
- gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD2.c -o build/temp.linux-i686-2.6/src/MD2.o
- src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录
- src/MD2.c:131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- In file included from src/MD2.c:147:
- src/hash_template.c:48: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’
- src/hash_template.c:59: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’
- src/hash_template.c: 在函数‘newALGobject’中:
- src/hash_template.c:69: 警告:隐式声明函数‘PyObject_New’
- src/hash_template.c:69: 错误:expected expression before ‘ALGobject’
- src/hash_template.c: 在文件层:
- src/hash_template.c:76: 错误:expected ‘)’ before ‘*’ token
- src/hash_template.c:91: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:110: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:122: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:162: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:188: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:190: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’
- src/hash_template.c:199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:225: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’
- src/hash_template.c:271: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
- src/hash_template.c:304: 错误:数组元素的类型不完全
- src/hash_template.c:305: 错误:‘PyCFunction’未声明(不在函数内)
- src/hash_template.c:305: 错误:expected ‘}’ before ‘ALG_new’
- src/hash_template.c: 在函数‘init_MD2’中:
- src/hash_template.c:339: 错误:‘PyObject’未声明(在此函数内第一次使用)
- src/hash_template.c:339: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
- src/hash_template.c:339: 错误:所在的函数内也只报告一次。)
- src/hash_template.c:339: 错误:‘m’未声明(在此函数内第一次使用)
- src/hash_template.c:351: 错误:‘ALGtype’未声明(在此函数内第一次使用)
- src/hash_template.c:351: 错误:‘PyType_Type’未声明(在此函数内第一次使用)
- src/hash_template.c:352: 警告:隐式声明函数‘Py_InitModule’
- src/hash_template.c:356: 错误:‘o’未声明(在此函数内第一次使用)
- src/hash_template.c:356: 警告:隐式声明函数‘PyInt_FromLong’
- src/hash_template.c:356: 警告:隐式声明函数‘PyDict_SetItemString’
- src/hash_template.c:356: 警告:隐式声明函数‘PyModule_GetDict’
- src/hash_template.c:356: 警告:隐式声明函数‘Py_DECREF’
- src/hash_template.c:360: 警告:隐式声明函数‘PyErr_Occurred’
- src/hash_template.c:361: 警告:隐式声明函数‘Py_FatalError’
- error: command 'gcc' failed with exit status 1
- ----------------------------------------
- Rolling back uninstall of pycrypto
- Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ai6cQR-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/pycrypto
- Storing complete log in /root/.pip/pip.log
二 解决方案
原因是少了Python的dev
- [niy@niy-computer /]$ sudo yum install python-devel
相关文章
- Python 基本语法,文件读写,数据结构和类型
- Python 迭代器,错误、异常处理
- 【华为OD机试真题 python】计算最大乘积 【2022 Q4 | 100分】
- Eclipse Kepler SR2 + Python 3.4 + JDK7+Pydev3.4 搭建 python 开发环境(MAC)
- 24岁非计算机专业工科妹子裸辞转行Python程序员,自学Python三个月,零基础如何系统学习python,从入门到精通?
- python多进程的使用(导包、创建子进程、启动子进程)
- 学python能做什么兼职-初学Python到月入过万最快的兼职途径(纯干货)
- 零基础自学Python需要多长时间从入门到精通?学python能兼职挣钱吗?怎么挣钱?
- 《Python数据挖掘:概念、方法与实践》一1.4 如何建立数据挖掘工作环境
- Python 程序员最常犯的十个错误
- Python爬虫技术--基础篇--IO编程
- 【Python】读写文件时 编码错误 https://www.cnblogs.com/baijing1/p/9885891.html
- 【python】+704个常用工具Python库
- Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续二)
- python之模块copy,了解概念即可
- 《Python高手之路》——导读
- Python参数组合
- python 对象(object)
- Python视频制作 MoviePy框架afx音频效果示例
- Python 数据分析教程之如何验证线性回归的假设,线性回归的假设是什么?以及如何用python验证它们?
- Python 教程之如何使用 matplotlib 在 python 中绘制数学函数
- 《Python语言程序设计》——1.8 程序设计错误
- Linux—yum的python版本错误——高级解决方案
- Python中应用虚拟环境
- Python之装饰器
- Python基础之异常处理+多层异常处理+人为抛出异常指定错误
- 华为OD机试 - 快递业务站(Python)
- 小学生python游戏编程arcade----爆炸粒子类
- VScode Python no module的解决方法
- 【Linux学习笔记】解决:yum install python-dev 报错(CentOS安装Python-dev库)
- 最新系统centos安装最新版python 3.8.5以及pip换源、临时指定源,pytest安装后的使用以及出现pytest命令not found无法识别