我正在使用VirtualBox 3.6开发OraclePythonFedora64位虚拟机。我已经配置了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即使使用这些devel工具,每当我尝试运行pip install时,都会收到一个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 install,但这并没有解决任何问题。
$ yum install python3-psutil.x86_64我在其他地方找到的最有帮助的信息是关于annobin和gcc 8.1.1之间的版本不匹配。但是,我使用的annobin版本似乎是经过修补的版本。
我在网上找不到关于'-fcf-protection=full‘错误的任何东西。我不确定这将如何影响气流,也不知道如何解决“cc1:errors”。
任何帮助或指导都将不胜感激。
发布于 2018-10-18 00:07:16
我也有同样的问题,但在安装Apache Airflow安装之前,我已经修复了它
sudo yum -y install gcc gcc-c++对我来说,来源是:-
https://medium.com/@0x0ece/installing-apache-airflow-on-centos-7-750c77b7aa35
发布于 2018-10-22 14:26:56
您正在将安装到一个虚拟环境中,但是构建psutil的工具链在那里对您不起作用。另外,故意使用yum install python3-psutil.x86_64安装预构建的psutil对您的虚拟环境没有任何影响。
您需要在安装到venv中的psutil系统包中使用符号链接,大概使用:ln -s /usr/lib/python3.6/dist-packages/psutil* $VIRTUAL_ENV/lib/python*/site-packages
发布于 2019-06-09 11:22:05
我可以通过dnf update annobin -y更新注解,在bugzilla上有相关的帖子
https://stackoverflow.com/questions/51940416
复制相似问题