error: command 'gcc' failed with exit status 1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: command 'gcc' failed with exit status 1相关的知识,希望对你有一定的参考价值。

   pip install  pycrypto报错

src/MD2.c:31:20: error: Python.h: No such file or directory
    src/MD2.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    In file included from src/MD2.c:136:
    src/hash_template.c:48: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
    src/hash_template.c:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PyTypeObject’
    src/hash_template.c: In function ‘newALGobject’:
    src/hash_template.c:69: warning: implicit declaration of function ‘PyObject_New’
    src/hash_template.c:69: error: expected expression before ‘ALGobject’
    src/hash_template.c: At top level:
    src/hash_template.c:76: error: expected ‘)’ before ‘*’ token
    src/hash_template.c:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:110: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:122: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:162: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:181: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALG_methods’
    src/hash_template.c:189: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ALGtype’
    src/hash_template.c:265: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    src/hash_template.c:298: error: array type has incomplete element type
    src/hash_template.c:299: error: ‘PyCFunction’ undeclared here (not in a function)
    src/hash_template.c:299: error: expected ‘}’ before ‘ALG_new’
    src/hash_template.c: In function ‘initMD2’:
    src/hash_template.c:333: error: ‘PyObject’ undeclared (first use in this function)
    src/hash_template.c:333: error: (Each undeclared identifier is reported only once
    src/hash_template.c:333: error: for each function it appears in.)
    src/hash_template.c:333: error: ‘m’ undeclared (first use in this function)
    src/hash_template.c:345: error: ‘ALGtype’ undeclared (first use in this function)
    src/hash_template.c:345: error: ‘PyType_Type’ undeclared (first use in this function)
    src/hash_template.c:346: warning: implicit declaration of function ‘Py_InitModule’
    src/hash_template.c:350: error: ‘o’ undeclared (first use in this function)
    src/hash_template.c:350: warning: implicit declaration of function ‘PyInt_FromLong’
    src/hash_template.c:350: warning: implicit declaration of function ‘PyDict_SetItemString’
    src/hash_template.c:350: warning: implicit declaration of function ‘PyModule_GetDict’
    src/hash_template.c:350: warning: implicit declaration of function ‘Py_DECREF’
    src/hash_template.c:354: warning: implicit declaration of function ‘PyErr_Occurred’
    src/hash_template.c:355: warning: implicit declaration of function ‘Py_FatalError’
    error: command ‘gcc‘ failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of pycrypto
Command "/usr/bin/python -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-mMnSOr/pycrypto/setup.py‘;exec(compile(getattr(tokenize, ‘open‘, opplace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --record /tmp/pip-aYu2Q8-record/install-record.txt --single-version-externally-managed --compile" fain /tmp/pip-build-mMnSOr/pycrypto


安装一下两个包

yum install gcc python-devel


本文出自 “LINUX” 博客,请务必保留此出处http://wangpengtai.blog.51cto.com/3882831/1975250

以上是关于error: command 'gcc' failed with exit status 1的主要内容,如果未能解决你的问题,请参考以下文章

centos error: command 'gcc' failed with exit status 1 错误

centos error: command 'gcc' failed with exit status 1

unable to execute 'gcc': No such file or directory error: command 'gcc' failed with

error: command 'gcc' failed with exit status 1

python安装模块的时候报错error: command 'gcc' failed with exit status 1

安装python模块报错 error: command 'gcc' failed with exit status 1