天天看点

python3安装web.py和psutil

1.安装web.py

安装web.py的python3.x的版本不能直接pip3 install web.py,因为会报一堆错误, 要想用pip3安装可以执行pip3 install web.py==0.40.dev0

2.安装psutil

安装psutil时,直接执行pip3 install psutil, 报错可能如下:

building 'psutil._psutil_linux' extension creating build/temp.linux-x86_64-3.4 creating build/temp.linux-x86_64-3.4/psutil x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=545 -DPSUTIL_LINUX=1 -I/usr/include/python3.4m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.4/psutil/_psutil_common.o psutil/_psutil_common.c:9:20: fatal error: Python.h: 没有那个文件或目录 #include <Python.h> ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

此时需要安装python-devel库,我的系统是ubuntu,执行:

apt-get install python3-dev即可。