码迷,mamicode.com
首页 > 其他好文 > 详细

还是环境问题,关于安装psutil

时间:2019-09-12 09:24:28      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:python   pil   bug   pip   apt   amp   protector   pytho   term   

pip install psutil 

   错误信息:

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/home/lxg/02dev/py3.6env/include -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc‘ failed with exit status 1

 

查阅资料,解决方式是执行 : sudo apt-get install python-dev 后再pip

但试过后,解决不料问题

 

最后解决方法:

 sudo apt-get install python3.6-dev

pip install psuitl

 

原因:

我的python环境有python3.5, 3.6 和2.7  , 估计前一篇博文中出现的类似问题,也是版本混用造成的. 

我目前的env环境是3.6的.

参考:https://github.com/giampaolo/psutil/issues/1143

 

还是环境问题,关于安装psutil

标签:python   pil   bug   pip   apt   amp   protector   pytho   term   

原文地址:https://www.cnblogs.com/lxgbky/p/11509907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!