복붙노트

[PYTHON] 오류 : eventlet을 설치하는 동안 'gcc'명령이 종료 상태 1로 실패했습니다.

PYTHON

오류 : eventlet을 설치하는 동안 'gcc'명령이 종료 상태 1로 실패했습니다.

나는 소프트웨어 배포를 위해 "Herd"를 갖기 위해 내 시스템에 eventlet을 설치하려고했지만 터미널에 gcc 오류가 표시됩니다.

  root@agrover-OptiPlex-780:~# easy_install -U eventlet
  Searching for eventlet
  Reading http://pypi.python.org/simple/eventlet/
  Reading http://wiki.secondlife.com/wiki/Eventlet
  Reading http://eventlet.net
   Best match: eventlet 0.9.16
    Processing eventlet-0.9.16-py2.7.egg
    eventlet 0.9.16 is already the active version in easy-install.pth

   Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg
 Processing dependencies for eventlet
 Searching for greenlet>=0.3
Reading http://pypi.python.org/simple/greenlet/
Reading https://github.com/python-greenlet/greenlet
Reading http://bitbucket.org/ambroff/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet-   0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272
Processing greenlet-0.3.4.zip
Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg
Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1`

왜 Python.h를 찾을 수 없습니까?

해결법

  1. ==============================

    1.파이썬 개발 헤더를 설치하지 않았기 때문에 설치에 실패했습니다. 우분투 / debian을 사용하면 다음과 같이 할 수 있습니다 :

    파이썬 개발 헤더를 설치하지 않았기 때문에 설치에 실패했습니다. 우분투 / debian을 사용하면 다음과 같이 할 수 있습니다 :

    sudo apt-get install python-dev 
    

    파이썬 3 사용 :

    sudo apt-get install python3-dev
    

    eventlet의 경우 libevent 라이브러리가 설치되어 있어야합니다. 따라서 libevent를 설치하면 오류에 대해 이야기 할 수 있습니다.

    sudo apt-get install libevent-dev
    
  2. ==============================

    2.Fedora의 경우 :

    Fedora의 경우 :

    sudo yum install python-devel
    
    sudo yum install libevent-devel
    

    그리고 마지막으로:

    sudo easy_install gevent
    
  3. ==============================

    3.나는 위의 모든 대답을 시도했다. 하지만 나를 위해 일한 것은 CentOS를위한 것이 었습니다.

    나는 위의 모든 대답을 시도했다. 하지만 나를 위해 일한 것은 CentOS를위한 것이 었습니다.

    sudo yum -y install gcc
    sudo yum install python-devel
    
  4. ==============================

    4.레드햇 버전 (CentOS 7) 아래 명령을 사용하여 파이썬 개발 패키지를 설치하십시오

    레드햇 버전 (CentOS 7) 아래 명령을 사용하여 파이썬 개발 패키지를 설치하십시오

    파이썬 2.7

    파이썬 3.4

    여전히 문제가 해결되지 않으면 패키지 아래에 설치하십시오 -

  5. ==============================

    5.CentOS 7.2의 경우 :

    CentOS 7.2의 경우 :

    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: CentOS
    Description:    CentOS Linux release 7.2.1511 (Core) 
    Release:    7.2.1511
    Codename:   Core
    

    이벤트 릿 설치 :

    sudo yum install python-devel
    sudo easy_install -ZU eventlet
    

    터미널 정보 :

    [root@localhost ~]# easy_install -ZU eventlet
    Searching for eventlet
    Reading http://pypi.python.org/simple/eventlet/
    Best match: eventlet 0.19.0
    Downloading https://pypi.python.org/packages/5a/e8/ac80f330a80c18113df0f4f872fb741974ad2179f8c2a5e3e45f40214cef/eventlet-0.19.0.tar.gz#md5=fde857181347d5b7b921541367a99204
    Processing eventlet-0.19.0.tar.gz
    Running eventlet-0.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Hh9GQY/eventlet-0.19.0/egg-dist-tmp-rBFoAx
    Adding eventlet 0.19.0 to easy-install.pth file
    
    Installed /usr/lib/python2.6/site-packages/eventlet-0.19.0-py2.6.egg
    Processing dependencies for eventlet
    Finished processing dependencies for eventlet
    
  6. ==============================

    6.openSUSE 42.1 Leap Linux에서는 이것을 사용합니다.

    openSUSE 42.1 Leap Linux에서는 이것을 사용합니다.

    sudo zypper install python3-devel
    
  7. ==============================

    7.이 시도 :

    이 시도 :

    sudo apt-get install libblas-dev libatlas-base-dev
    

    우분투 14.04에서도 비슷한 문제가 발생했습니다. 나를 위해 다음 우분투 패키지

  8. ==============================

    8.소스에서 빌드하고 설치하면 최신 릴리스 (10.3 이상)에서 수정되었습니다.

    소스에서 빌드하고 설치하면 최신 릴리스 (10.3 이상)에서 수정되었습니다.

    mkdir -p /tmp/install/netifaces/
    cd /tmp/install/netifaces && wget -O "netifaces-0.10.4.tar.gz" "https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e"
    tar xvzf netifaces-0.10.4.tar.gz
    cd netifaces-0.10.4 && python setup.py install
    
  9. ==============================

    9.MacOS에서 컴파일하기 위해 gcc가 필요한 피탄을 필요로하는 fbprophet을 설치하는 데 어려움이있었습니다. 일관되게 동일한 오류가 발생합니다. 'gcc'명령이 종료 상태 1에서 실패했습니다.

    MacOS에서 컴파일하기 위해 gcc가 필요한 피탄을 필요로하는 fbprophet을 설치하는 데 어려움이있었습니다. 일관되게 동일한 오류가 발생합니다. 'gcc'명령이 종료 상태 1에서 실패했습니다.

    나는 나 자신을 위해 문제를 고쳤다 고 생각한다.

    bcc를 설치하여 최신 버전을 설치하면 gcc-8이됩니다.

    그렇다면 gcc가 실행될 때 대신 gcc-8을 사용하게되었습니다.

    내 .zshrc (.bashrc와 동일하지만 zsh)에 별명 gcc = 'gcc-8을 추가했기 때문에 또는 export PATH = / usr / local / bin을 실행했기 때문에 작동했습니다 : $ PATH (주석 참조)

    또한 : 내 모든 시도는 가상 환경 내부에 있었고 전 세계적으로 (pip와 함께) fbprophet을 설치하여 성공했지만 venv 내에서는 성공하지 못했습니다.

  10. from https://stackoverflow.com/questions/11094718/error-command-gcc-failed-with-exit-status-1-while-installing-eventlet by cc-by-sa and MIT license