SRC/MD2.C:31:20: Error: Python.h: no file or directory

Source: Internet
Author: User
Tags gmp

First, preface

There was a problem installing fabric on CentOS, first installed Pip, using PIP to execute the following command pip install

The following issues occur

[Plain]View PlainCopy
  1. [[email protected]/]$ 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: Error: Python.h: no file or directory
  15. src/md2.c:131: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  16. In file included from src/md2.c:147:
  17. SRC/HASH_TEMPLATE.C:48: Error: expected specifier-qualifier-list before ' Pyobject_head '
  18. SRC/HASH_TEMPLATE.C:59: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' pytypeobject '
  19. SRC/HASH_TEMPLATE.C: In the function ' Newalgobject ':
  20. SRC/HASH_TEMPLATE.C:69: Warning: Implicitly declaring function ' Pyobject_new '
  21. SRC/HASH_TEMPLATE.C:69: Error: expected expression before ' algobject '
  22. SRC/HASH_TEMPLATE.C: At the file level:
  23. SRC/HASH_TEMPLATE.C:76: Error: expected ') ' before ' * ' token
  24. SRC/HASH_TEMPLATE.C:91: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  25. SRC/HASH_TEMPLATE.C:110: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  26. src/hash_template.c:122: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  27. SRC/HASH_TEMPLATE.C:162: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  28. src/hash_template.c:188: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  29. SRC/HASH_TEMPLATE.C:190: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' alg_methods '
  30. src/hash_template.c:199: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  31. SRC/HASH_TEMPLATE.C:225: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' Algtype '
  32. src/hash_template.c:271: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  33. src/hash_template.c:304: Error: The type of the array element is not fully
  34. src/hash_template.c:305: Error: ' Pycfunction ' not declared (not inside function)
  35. src/hash_template.c:305: Error: expected '} ' before ' Alg_new '
  36. SRC/HASH_TEMPLATE.C: In the function ' INIT_MD2 ':
  37. src/hash_template.c:339: Error: ' Pyobject ' not declared (first use within this function)
  38. src/hash_template.c:339: Error: (even if multiple occurrences occur within a function, each undeclared identifier is in its
  39. src/hash_template.c:339: Error: The function inside is also reported only once. )
  40. src/hash_template.c:339: Error: ' m ' not declared (first use within this function)
  41. src/hash_template.c:351: Error: ' Algtype ' not declared (first use within this function)
  42. src/hash_template.c:351: Error: ' Pytype_type ' not declared (first use within this function)
  43. src/hash_template.c:352: Warning: Implicitly declaring function ' Py_initmodule '
  44. src/hash_template.c:356: Error: ' O ' is not declared (first use within this function)
  45. src/hash_template.c:356: Warning: Implicitly declaring function ' Pyint_fromlong '
  46. src/hash_template.c:356: Warning: Implicitly declaring function ' pydict_setitemstring '
  47. src/hash_template.c:356: Warning: Implicitly declaring function ' Pymodule_getdict '
  48. src/hash_template.c:356: Warning: Implicitly declaring function ' Py_decref '
  49. SRC/HASH_TEMPLATE.C:360: Warning: Implicitly declaring function ' pyerr_occurred '
  50. src/hash_template.c:361: Warning: Implicitly declaring function ' 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: Error: Python.h: no file or directory
  62. src/md2.c:131: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  63. In file included from src/md2.c:147:
  64. SRC/HASH_TEMPLATE.C:48: Error: expected specifier-qualifier-list before ' Pyobject_head '
  65. SRC/HASH_TEMPLATE.C:59: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' pytypeobject '
  66. SRC/HASH_TEMPLATE.C: In the function ' Newalgobject ':
  67. SRC/HASH_TEMPLATE.C:69: Warning: Implicitly declaring function ' Pyobject_new '
  68. SRC/HASH_TEMPLATE.C:69: Error: expected expression before ' algobject '
  69. SRC/HASH_TEMPLATE.C: At the file level:
  70. SRC/HASH_TEMPLATE.C:76: Error: expected ') ' before ' * ' token
  71. SRC/HASH_TEMPLATE.C:91: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  72. SRC/HASH_TEMPLATE.C:110: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  73. src/hash_template.c:122: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  74. SRC/HASH_TEMPLATE.C:162: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  75. src/hash_template.c:188: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  76. SRC/HASH_TEMPLATE.C:190: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' alg_methods '
  77. src/hash_template.c:199: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  78. SRC/HASH_TEMPLATE.C:225: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' Algtype '
  79. src/hash_template.c:271: Error: expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
  80. src/hash_template.c:304: Error: The type of the array element is not fully
  81. src/hash_template.c:305: Error: ' Pycfunction ' not declared (not inside function)
  82. src/hash_template.c:305: Error: expected '} ' before ' Alg_new '
  83. SRC/HASH_TEMPLATE.C: In the function ' INIT_MD2 ':
  84. src/hash_template.c:339: Error: ' Pyobject ' not declared (first use within this function)
  85. src/hash_template.c:339: Error: (even if multiple occurrences occur within a function, each undeclared identifier is in its
  86. src/hash_template.c:339: Error: The function inside is also reported only once. )
  87. src/hash_template.c:339: Error: ' m ' not declared (first use within this function)
  88. src/hash_template.c:351: Error: ' Algtype ' not declared (first use within this function)
  89. src/hash_template.c:351: Error: ' Pytype_type ' not declared (first use within this function)
  90. src/hash_template.c:352: Warning: Implicitly declaring function ' Py_initmodule '
  91. src/hash_template.c:356: Error: ' O ' is not declared (first use within this function)
  92. src/hash_template.c:356: Warning: Implicitly declaring function ' Pyint_fromlong '
  93. src/hash_template.c:356: Warning: Implicitly declaring function ' pydict_setitemstring '
  94. src/hash_template.c:356: Warning: Implicitly declaring function ' Pymodule_getdict '
  95. src/hash_template.c:356: Warning: Implicitly declaring function ' Py_decref '
  96. SRC/HASH_TEMPLATE.C:360: Warning: Implicitly declaring function ' pyerr_occurred '
  97. src/hash_template.c:361: Warning: Implicitly declaring function ' 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

Second Solution

The reason is that the Python dev is less

[Plain]View PlainCopy
      1. [email protected]/]$ sudo yum install Python-devel

SRC/MD2.C:31:20: Error: Python.h: no file or directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.