在Linux平台下,pip install psutil 安裝python psutil包,出現下面的錯誤:
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
原因是沒有安裝python-devel(ubuntu的為python-dev)的包。
如果是python3 則需要安裝python3-devel,(Ubuntu為python3-dev)
安裝完成后,執行pip install psutil 即可。