简体   繁体   中英

How i can install psutil on a alpine chroot on arch linux?

Well, i need an alpine chroot for run my Mongo DB Server, but i can't because when i run the /usr/bin/python3 -m pip install -r etc/pip/compile-requirements.txt, it return's to me this error:

    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.

I searched it on Google, and i dont founded anything.

Try installing linux headers:

RUN apk add linux-headers

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