简体   繁体   中英

Installing superset: error: command 'gcc' failed with exit status 1

I try to install superset on Centos 7, i've followed the official site Apache Superset and i've installed all required dependencies:

sudo yum upgrade python-setuptools
Plugin abilitati:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.inode.at
 * centosplus: mirror.inode.at
 * epel: mirror.inode.at
 * extras: mirror.nextlayer.at

No packages marked for update
The gcc-4.8.5-39.el7.x86_64 package is already installed and updated to the latest version
The gcc-c ++ - 4.8.5-39.el7.x86_64 package is already installed and updated to the latest version
The libffi-devel-3.0.13-18.el7.x86_64 package is already installed and updated to the latest version
The python-devel-2.7.5-86.el7.x86_64 package is already installed and updated to the latest version
The python2-pip-8.1.2-12.el7.noarch package is already installed and updated to the latest version
The python2-wheel-0.29.0-2.el7.noarch package is already installed and updated to the latest version
Package 1: openssl-devel-1.0.2k-19.el7.x86_64 is already installed and updated to the latest version
The cyrus-sasl-devel-2.1.26-23.el7.x86_64 package is already installed and updated to the latest version
The openldap-devel-2.4.44-21.el7_6.x86_64 package is already installed and updated to the latest version

But i've this error when execute

pip install apache-superset

for python-geohash

   ERROR: Command errored out with exit status 1:
     command: /home/mik/supersetvenv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6xsufws2/python-geohash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6xsufws2/python-geohash/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rvrvxjco/install-record.txt --single-version-externally-managed --compile --install-headers /home/mik/supersetvenv/include/site/python3.6/python-geohash
         cwd: /tmp/pip-install-6xsufws2/python-geohash/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    copying geohash.py -> build/lib.linux-x86_64-3.6
    copying quadtree.py -> build/lib.linux-x86_64-3.6
    copying jpgrid.py -> build/lib.linux-x86_64-3.6
    copying jpiarea.py -> build/lib.linux-x86_64-3.6
    running build_ext
    building '_geohash' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -stdlib=libc++ -fPIC -DPYTHON_MODULE=1 -I/home/mik/supersetvenv/include -I/usr/include/python3.6m -c src/geohash.cpp -o build/temp.linux-x86_64-3.6/src/geohash.o
    gcc: error: unrecognized command line option ‘-stdlib=libc++’
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/mik/supersetvenv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6xsufws2/python-geohash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6xsufws2/python-geohash/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rvrvxjco/install-record.txt --single-version-externally-managed --compile --install-headers /home/mik/supersetvenv/include/site/python3.6/python-geohash Check the logs for full command output.

Someone can help me?

Try these steps..

    sudo yum -y upgrade python-setuptools
    pip install --upgrade setuptools pip
    pip install --upgrade pip
    pip3 install --upgrade pip
    # hash -r
    pip install virtualenv

    python3 -m venv venv
    . venv/bin/activate

    pip install --upgrade setuptools pip

    pause 'Pause - press Enter to continue'

    # Install superset
    pip install superset
    pip uninstall --yes pandas
    pip install pandas==0.23.4
    pip install sqlalchemy==1.2.18
    pip install flask==1.0.0

    # Initialize the database
    superset db upgrade

I find the solution: I remove packages gcc gcc-c++ libffi-devel python-devel and I reinstall them

sudo yum erase gcc gcc-c++ libffi-devel python-devel

sudo yum install gcc gcc-c++ libffi-devel python-devel

Because in /usr/include/python3.6m I didn't have file *.h to include in the compilation.

Same issue, and Mik's answer is the solution.

But in addition to his answer: Now the python-devel is called python36-devel . Use this to check the correct name if someone had the problem about "can't find python-devel" .

# check the name of python.devel
> sudo yum search python3 | grep devel

# install the python36.devel
> sudo yum install python36.devel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM