我正在尝试在我的树莓派上安装psutil,但似乎无法正常运行。如果我执行pip install,就会出现以下错误:
psutil/_psutil_linux.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import
setuptools;__file__='/home/pi/build/psutil/setup.py';exec(compile(open(__file__).read().replace('\r\n ', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-V39ila-record/install-record.txt failed with error code 1 in /home/pi/build/psutil
Storing complete log in /root/.pip/pip.log
如果我在安装文件所在目录尝试运行python setup.py build,则会出现以下错误:
psutil/_psutil_linux.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
如果有人能帮我安装这个,那就太好了。
sudo apt-get build-dep python
命令,您需要确保在源列表中有一些源 URI。否则,非常好的答案。 - Martin Haeberlisudo apt-get install python3-dev
。 - Alex028502