安装apache-airflow时出现“ gcc”错误

时间:2018-08-21 01:28:05

标签: gcc airflow psutil

我正在使用Python3.6开发Oracle VirtualBox Fedora 64位VM。我已经配置了一个venv来安装apache-airflow。我的pip3已更新为18.0,并且我已经用yum安装了许多开发工具:

$ yum groupinstall "Development tools"
$ yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel python3-devel.x86_64 cyrus-sasl-devel.x86_64
$ yum install python3-psutil.x86_64
$ yum install libevent-devel

即使使用这些开发工具,每当我尝试运行pip安装时,都会出现gcc错误:

$ pip3 install apache-airflow

错误及其之前的终端输出如下:

running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
creating build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=442 -DPSUTIL_LINUX=1 -I/home/jsexauer/include -I/usr/include/python3.6m -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_linux.o
annobin: _psutil_linux.c: Error: plugin built for compiler version (8.0.1) but run with compiler version (8.1.1)
cc1: error: fail to initialize plugin /usr/lib/gcc/x86_64-redhat-linux/8/plugin/annobin.so
cc1: error: ‘-fcf-protection=full’ requires Intel CET support. Use -mcet or both of -mibt and -mshstk options to enable CET
error: command 'gcc' failed with exit status 1

似乎psutil或gcc出现错误,这就是为什么我为psutil运行yum安装,但没有解决任何问题。

 $ yum install python3-psutil.x86_64

我在其他地方找到的最有用的信息是有关annobin和gcc 8.1.1之间的版本不匹配。但是,我拥有的annobin版本似乎是补丁版本。

关于'-fcf-protection = full'错误,我没有在网上找到任何内容。我不确定这将如何影响气流,也不确定如何解决“ cc1:错误”。

任何帮助或指导将不胜感激。

3 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,但得到了解决 在安装Apache Airflow之前,请安装

sudo yum -y install gcc gcc-c++

对我来说,来源是:-

https://medium.com/@0x0ece/installing-apache-airflow-on-centos-7-750c77b7aa35

答案 1 :(得分:0)

您正在安装到虚拟环境中,但是用于构建psutil的工具链在那里不起作用。另外,将预构建的psutilyum install python3-psutil.x86_64一起安装不会对您的虚拟环境有任何影响。

您需要在安装到venv的psutil的系统软件包中进行符号链接,大致与:ln -s /usr/lib/python3.6/dist-packages/psutil* $VIRTUAL_ENV/lib/python*/site-packages

答案 2 :(得分:0)

我可以通过dnf update annobin -y更新annobin,bugzilla上有一个相关线程