gcc 如何在archlinux的alpine chroot上安装psutil?

9nvpjoqh  于 2022-11-13  发布在  Linux
关注(0)|答案(1)|浏览(262)

好吧,我需要一个alpine chroot来运行我的Mongo DB服务器,但我不能,因为当我运行/usr/bin/python3 -m pip install -r etc/pip/compile-requirements.txt时,它返回给我这个错误:

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.9/psutil/_psutil_common.o
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/include/python3.9 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-3.9/psutil/_psutil_linux.o
    psutil/_psutil_linux.c:19:10: fatal error: linux/version.h: No such file or directory
       19 | #include <linux/version.h>
          |          ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o_fhhi2e/psutil_0a9d27309a03482b80a67c750b3ed64d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o_fhhi2e/psutil_0a9d27309a03482b80a67c750b3ed64d/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-h383bgkd/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/psutil Check the logs for full command output.

我在谷歌上搜索了一下,什么也没找到。

dbf7pr2w

dbf7pr2w1#

尝试安装linux头文件:
运行apk添加Linux头文件

相关问题