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

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

我尝试在Centos 7上安装superset,我已经关注了官网 Apache Superset 我已经安装了所有必需的依赖项:

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

但是我在执行时出现了这个错误

pip install apache-superset

对于 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.

有人可以帮助我吗?

试试这些步骤..

    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

我找到了解决办法: 我删除包 gcc gcc-c++ libffi-devel python-devel 并重新安装它们

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

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

因为在 /usr/include/python3.6m 中我没有要包含在编译中的文件 *.h。

同样的问题, 是解决方案。

但除了他的回答:现在 python-devel 被称为 python36-devel。如果有人有关于 "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