zoukankan      html  css  js  c++  java
  • src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录

    一、前言

                      在CentOS 上安装fabric时出现问题,首先已安装pip, 用pip执行以下命令pip install 

    出现以下问题

    1. [niy@niy-computer /]$ sudo pip install fabric  
    2. Requirement already satisfied (use --upgrade to upgrade): fabric in /usr/lib/python2.6/site-packages/Fabric-1.3.1-py2.6.egg  
    3. 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)  
    4. Downloading/unpacking pycrypto>=2.1,!=2.4 (from ssh>=1.7.8->fabric)  
    5.   Running setup.py egg_info for package pycrypto  
    6. Installing collected packages: pycrypto  
    7.   Found existing installation: pycrypto 2.0.1  
    8.     Uninstalling pycrypto:  
    9.       Successfully uninstalled pycrypto  
    10.   Running setup.py install for pycrypto  
    11.     warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.  
    12.     building 'Crypto.Hash._MD2' extension  
    13.     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  
    14.     src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录  
    15.     src/MD2.c:131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    16.     In file included from src/MD2.c:147:  
    17.     src/hash_template.c:48: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’  
    18.     src/hash_template.c:59: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’  
    19.     src/hash_template.c: 在函数‘newALGobject’中:  
    20.     src/hash_template.c:69: 警告:隐式声明函数‘PyObject_New’  
    21.     src/hash_template.c:69: 错误:expected expression before ‘ALGobject’  
    22.     src/hash_template.c: 在文件层:  
    23.     src/hash_template.c:76: 错误:expected ‘)’ before ‘*’ token  
    24.     src/hash_template.c:91: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    25.     src/hash_template.c:110: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    26.     src/hash_template.c:122: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    27.     src/hash_template.c:162: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    28.     src/hash_template.c:188: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    29.     src/hash_template.c:190: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’  
    30.     src/hash_template.c:199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    31.     src/hash_template.c:225: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’  
    32.     src/hash_template.c:271: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    33.     src/hash_template.c:304: 错误:数组元素的类型不完全  
    34.     src/hash_template.c:305: 错误:‘PyCFunction’未声明(不在函数内)  
    35.     src/hash_template.c:305: 错误:expected ‘}’ before ‘ALG_new’  
    36.     src/hash_template.c: 在函数‘init_MD2’中:  
    37.     src/hash_template.c:339: 错误:‘PyObject’未声明(在此函数内第一次使用)  
    38.     src/hash_template.c:339: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其  
    39.     src/hash_template.c:339: 错误:所在的函数内也只报告一次。)  
    40.     src/hash_template.c:339: 错误:‘m’未声明(在此函数内第一次使用)  
    41.     src/hash_template.c:351: 错误:‘ALGtype’未声明(在此函数内第一次使用)  
    42.     src/hash_template.c:351: 错误:‘PyType_Type’未声明(在此函数内第一次使用)  
    43.     src/hash_template.c:352: 警告:隐式声明函数‘Py_InitModule’  
    44.     src/hash_template.c:356: 错误:‘o’未声明(在此函数内第一次使用)  
    45.     src/hash_template.c:356: 警告:隐式声明函数‘PyInt_FromLong’  
    46.     src/hash_template.c:356: 警告:隐式声明函数‘PyDict_SetItemString’  
    47.     src/hash_template.c:356: 警告:隐式声明函数‘PyModule_GetDict’  
    48.     src/hash_template.c:356: 警告:隐式声明函数‘Py_DECREF’  
    49.     src/hash_template.c:360: 警告:隐式声明函数‘PyErr_Occurred’  
    50.     src/hash_template.c:361: 警告:隐式声明函数‘Py_FatalError’  
    51.     error: command 'gcc' failed with exit status 1  
    52.     Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace(' ', ' '), __file__, 'exec'))" install --record /tmp/pip-Ai6cQR-record/install-record.txt --single-version-externally-managed:  
    53.     running install  
    54.   
    55. running build  
    56.   
    57. running build_py  
    58.   
    59. running build_ext  
    60.   
    61. running build_configure  
    62.   
    63. warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.  
    64.   
    65. building 'Crypto.Hash._MD2' extension  
    66.   
    67. 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  
    68.   
    69. src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录  
    70.   
    71. src/MD2.c:131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    72.   
    73. In file included from src/MD2.c:147:  
    74.   
    75. src/hash_template.c:48: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’  
    76.   
    77. src/hash_template.c:59: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’  
    78.   
    79. src/hash_template.c: 在函数‘newALGobject’中:  
    80.   
    81. src/hash_template.c:69: 警告:隐式声明函数‘PyObject_New’  
    82.   
    83. src/hash_template.c:69: 错误:expected expression before ‘ALGobject’  
    84.   
    85. src/hash_template.c: 在文件层:  
    86.   
    87. src/hash_template.c:76: 错误:expected ‘)’ before ‘*’ token  
    88.   
    89. src/hash_template.c:91: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    90.   
    91. src/hash_template.c:110: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    92.   
    93. src/hash_template.c:122: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    94.   
    95. src/hash_template.c:162: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    96.   
    97. src/hash_template.c:188: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    98.   
    99. src/hash_template.c:190: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’  
    100.   
    101. src/hash_template.c:199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    102.   
    103. src/hash_template.c:225: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’  
    104.   
    105. src/hash_template.c:271: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token  
    106.   
    107. src/hash_template.c:304: 错误:数组元素的类型不完全  
    108.   
    109. src/hash_template.c:305: 错误:‘PyCFunction’未声明(不在函数内)  
    110.   
    111. src/hash_template.c:305: 错误:expected ‘}’ before ‘ALG_new’  
    112.   
    113. src/hash_template.c: 在函数‘init_MD2’中:  
    114.   
    115. src/hash_template.c:339: 错误:‘PyObject’未声明(在此函数内第一次使用)  
    116.   
    117. src/hash_template.c:339: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其  
    118.   
    119. src/hash_template.c:339: 错误:所在的函数内也只报告一次。)  
    120.   
    121. src/hash_template.c:339: 错误:‘m’未声明(在此函数内第一次使用)  
    122.   
    123. src/hash_template.c:351: 错误:‘ALGtype’未声明(在此函数内第一次使用)  
    124.   
    125. src/hash_template.c:351: 错误:‘PyType_Type’未声明(在此函数内第一次使用)  
    126.   
    127. src/hash_template.c:352: 警告:隐式声明函数‘Py_InitModule’  
    128.   
    129. src/hash_template.c:356: 错误:‘o’未声明(在此函数内第一次使用)  
    130.   
    131. src/hash_template.c:356: 警告:隐式声明函数‘PyInt_FromLong’  
    132.   
    133. src/hash_template.c:356: 警告:隐式声明函数‘PyDict_SetItemString’  
    134.   
    135. src/hash_template.c:356: 警告:隐式声明函数‘PyModule_GetDict’  
    136.   
    137. src/hash_template.c:356: 警告:隐式声明函数‘Py_DECREF’  
    138.   
    139. src/hash_template.c:360: 警告:隐式声明函数‘PyErr_Occurred’  
    140.   
    141. src/hash_template.c:361: 警告:隐式声明函数‘Py_FatalError’  
    142.   
    143. error: command 'gcc' failed with exit status 1  
    144.   
    145. ----------------------------------------  
    146.   Rolling back uninstall of pycrypto  
    147. Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace(' ', ' '), __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  
    148. Storing complete log in /root/.pip/pip.log  

    二 解决方案

    原因是少了Python的dev

      1. [niy@niy-computer /]$ sudo yum  install python-devel 
  • 相关阅读:
    20135213——信息安全系统设计基础第十周学习总结
    20135213 20135231 信息安全系统设计基础课程第一次实验报告
    20135213——信息安全系统设计基础第九周学习总结
    家庭作业 汇总(更新调整)
    20135213——信息安全系统设计基础第八周期中总结
    家庭作业第三章3.57
    20135213——信息安全系统设计基础第七周学习总结
    20135213——信息安全系统设计基础第六周学习总结
    笔记
    20135213-信息安全系统设计基础第四周学习总结
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/6746255.html
Copyright © 2011-2022 走看看