一、前言

在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('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ai6cQR-record/install-record.txt --single-version-externally-managed:
  53. running install
  54. running build
  55. running build_py
  56. running build_ext
  57. running build_configure
  58. warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
  59. building 'Crypto.Hash._MD2' extension
  60. 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
  61. src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录
  62. src/MD2.c:131: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  63. In file included from src/MD2.c:147:
  64. src/hash_template.c:48: 错误:expected specifier-qualifier-list before ‘PyObject_HEAD’
  65. src/hash_template.c:59: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’
  66. src/hash_template.c: 在函数‘newALGobject’中:
  67. src/hash_template.c:69: 警告:隐式声明函数‘PyObject_New’
  68. src/hash_template.c:69: 错误:expected expression before ‘ALGobject’
  69. src/hash_template.c: 在文件层:
  70. src/hash_template.c:76: 错误:expected ‘)’ before ‘*’ token
  71. src/hash_template.c:91: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  72. src/hash_template.c:110: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  73. src/hash_template.c:122: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  74. src/hash_template.c:162: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  75. src/hash_template.c:188: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  76. src/hash_template.c:190: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’
  77. src/hash_template.c:199: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  78. src/hash_template.c:225: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’
  79. src/hash_template.c:271: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  80. src/hash_template.c:304: 错误:数组元素的类型不完全
  81. src/hash_template.c:305: 错误:‘PyCFunction’未声明(不在函数内)
  82. src/hash_template.c:305: 错误:expected ‘}’ before ‘ALG_new’
  83. src/hash_template.c: 在函数‘init_MD2’中:
  84. src/hash_template.c:339: 错误:‘PyObject’未声明(在此函数内第一次使用)
  85. src/hash_template.c:339: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
  86. src/hash_template.c:339: 错误:所在的函数内也只报告一次。)
  87. src/hash_template.c:339: 错误:‘m’未声明(在此函数内第一次使用)
  88. src/hash_template.c:351: 错误:‘ALGtype’未声明(在此函数内第一次使用)
  89. src/hash_template.c:351: 错误:‘PyType_Type’未声明(在此函数内第一次使用)
  90. src/hash_template.c:352: 警告:隐式声明函数‘Py_InitModule’
  91. src/hash_template.c:356: 错误:‘o’未声明(在此函数内第一次使用)
  92. src/hash_template.c:356: 警告:隐式声明函数‘PyInt_FromLong’
  93. src/hash_template.c:356: 警告:隐式声明函数‘PyDict_SetItemString’
  94. src/hash_template.c:356: 警告:隐式声明函数‘PyModule_GetDict’
  95. src/hash_template.c:356: 警告:隐式声明函数‘Py_DECREF’
  96. src/hash_template.c:360: 警告:隐式声明函数‘PyErr_Occurred’
  97. src/hash_template.c:361: 警告:隐式声明函数‘Py_FatalError’
  98. error: command 'gcc' failed with exit status 1
  99. ----------------------------------------
  100. Rolling back uninstall of pycrypto
  101. 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
  102. Storing complete log in /root/.pip/pip.log

二 解决方案

原因是少了Python的dev

    1. [niy@niy-computer /]$ sudo yum  install python-devel

src/MD2.c:31:20: 错误:Python.h:没有那个文件或目录的更多相关文章

  1. qingstor python-sdk 安装错误 src/MD2.c:31:20: fatal error: Python.h: No such file or directory

    ubuntu安装python qingstor-sdk, src/MD2.c:31:20: fatal error: Python.h: No such file or directory compi ...

  2. 解决 src/MD2.c:31:20: fatal error: Python.h: No such file or directory安装包错误

    在linux命令行安装包时报错 src/MD2.c:31:20: fatal error: Python.h: No such file or directory 原因:缺少了python的dev 解 ...

  3. python.h没有那个文件或目录解决方法

    我用的是Deepin Linux,这应该是linux平台的问题,别的linux os也是执行安装,命令不同而已,windows和Mac不太清楚. 如果你使用的是python2.x,那么使用下面的语句: ...

  4. _mysql.c:29:20: error: Python.h: No such file or directory

    在Centos系统中安装 pip install MySQL-python 提示: _mysql.c:29:20: error: Python.h: No such file or directory ...

  5. busybox编译 fatal error: curses.h: 没有那个文件或目录解决办法

    执行make menuconfig时出现如下错误@ubuntu:/home/dev/busybox-1.19.3# make menuconfig HOSTCC scripts/kconfig/lxd ...

  6. fatal error: openssl/evp.h: 没有那个文件或目录

    在陆佳华<嵌入式系统软硬件协同设计实战指南 第2版>一书的第13章节 编译U-boot时会遇到2个错误.原因很简单,就从一开始的错误提示着手: fatal error: openssl/e ...

  7. 【caffe编译】 fatal error: hdf5.h: 没有那个文件或目录

    src/caffe/layers/hdf5_output_layer.cpp:3:18: fatal error: hdf5.h: 没有那个文件或目录 查找文件 locate hdf5.h 修改Mak ...

  8. error: stdio.h: 没有那个文件或目录

    在64位系统中,编写一个C语言程序后,使用gcc进行编译时,出现了如下的错误: test.c:1:19: fatal  error: stdio.h: 没有那个文件或目录 #include <s ...

  9. fastdfs+nginx make时报错fatal error:fdfs_define.h: 没有那个文件或目录

    环境: ubuntu 18.04.1 fastdfs-nginx-module_v1.16 root@wang-machine:~/桌面/FastDFS# cd nginx-1.8.1/root@wa ...

随机推荐

  1. info---Linux下info格式的帮助指令。

    info命令是Linux下info格式的帮助指令. 它的几个常用快捷键. ?键:它就会显示info的常用快捷键. N键:显示(相对于本节点的)下一节点的文档内容. P键:显示(相对于本节点的)前一节点 ...

  2. php如何openssl_encrypt加密解密

    最近在对接客户的CRM系统,获取令牌时,要用DES方式加密解密,由于之前没有搞错这种加密方式,经过请教了"百度"和"谷歌"两个老师后,结合了多篇文档内容后,终于 ...

  3. caioj 1067动态规划入门(一维一边推5: 乘积最大(高精度版))

    因为这里涉及到乘号的个数,那么我们可以用f[i][j]表示前i个位乘号为j个时的最大乘积 那么相比上一题就是多了一层枚举多少个乘号的循环,可以得出 f[i][r] = max(f[j - 1][r - ...

  4. Android旋转屏幕后国际化语言失效的解决的方法

    本文已同步至个人博客:liyuyu.cn 近期在项目中使用到了国际化多语言(英文+中文),但在使用时发现了一个问题.当屏幕旋转后.APP语言(中文)自己主动转换为了系统语言(英文).设置了Activi ...

  5. vue6 发请求

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. cookies,sessionStorage和localStorage的区别

    共同点:都是保存在浏览器端,且同源的.区别:cookie数据始终在同源的http请求中携带(即使不需要),即cookie在浏览器和服务器间来回传递.而sessionStorage和localStora ...

  7. javascript中运算符有哪些? 他们的优先级 呢?

    一元操作符 ++, -- + -(正负)逻辑操作符 ! && ||基本运算符 +, -, *, /, %关系操作符 >, <, >=, <=, ===, ==, ...

  8. POJ 1167 The Buses 暴搜+剪枝

    思路: 先把能选的路线都预处理出来 按照能停的车的多少排个序 (剪枝1) 搜搜搜 如果当前剩的车÷当前能停车的多少+deep>=ans剪掉 (剪枝2) //By SiriusRen #inclu ...

  9. HDU 5358 First One 数学+尺取法

    多校的题,摆明了数学题,但是没想出来,蠢爆了,之前算了半天的s[i][j]的和,其实是积.其实比赛的时候我连log(s[i][j])+1是s[i][j]的位数都没看出来,说出来都丢人. 知道了这个之后 ...

  10. 实时监控Cat之旅~分布式消息树的实现原理与测试

    大众点评的老吴在InfoQ上讲了Cat之后,有不少同仁开始关注这个实时监控系统,但学习的文章甚少,在GitHub上也是一言代过,给我们这些开发人员留下了N多个疑问,一时间不知道去哪里问,向谁去问了,通 ...