error: command 'gcc' failed with exit status 1 on CentOS

前端 未结 7 2118
甜味超标
甜味超标 2020-12-23 09:48

I\'m trying to install lxml package on CentOS using sudo pip install lxml and its throwing this error right at the end:

error:

error:          


        
相关标签:
7条回答
  • 2020-12-23 10:16

    I bet you have to install libxml2-devel or libxml++-devel or even python-devel. But it is only a wild guess, not seeing the actual error from the log file. But it seems gcc is missing either a header file or a library file.

    0 讨论(0)
  • 2020-12-23 10:17
    sudo yum install python36 python36-devel python36-libs python36-tools
    

    if using python36, this is the best path for set up. Corrected this error for me on an aws ec2 instance

    0 讨论(0)
  • 2020-12-23 10:20
    pip install -U pip
    pip install -U cython
    
    0 讨论(0)
  • 2020-12-23 10:23
    yum install gcc-c++
    

    on aws ec2 (aws linux),it works

    优秀

    0 讨论(0)
  • 2020-12-23 10:38

    How i solved

    # yum update
    # yum install -y https://centos7.iuscommunity.org/ius-release.rpm
    # yum install -y python36u python36u-libs python36u-devel python36u-pip
    # pip3.6 install pipenv
    

    I hope it will help Someone to resolve "gcc" issue.

    0 讨论(0)
  • 2020-12-23 10:40

    " error: command 'gcc' failed with exit status 1 ". the installation failed because of missing python-devel and some dependencies.

    the best way to correct gcc problem:

    You need to reinstall gcc , gcc-c++ and dependencies.

    For python 2.7

    $ sudo yum -y install gcc gcc-c++ kernel-devel
    $ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
    $ pip install "your python packet"
    

    For python 3.4

    $ sudo apt-get install python3-dev
    $ pip install "your python packet"
    

    Hope this will help.

    0 讨论(0)
提交回复
热议问题