python3 安装psutil安装报错的解决方案

环境:系统:Centos python:V3.6.8 一直遇到psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory,在网上搜了很久,都没找到解决方案,我尝试过用豆瓣(http://pypi.douban.com/simple) 以及清华的源,但是都不行。最后我在odoo的群里问,有位朋友回复说需要安装gcc,于是我先安装gcc yum -y ...
摘要由CSDN通过智能技术生成

环境:

系统:Centos

       python:V3.6.8

     

一直遇到psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory

,在网上搜了很久,都没找到解决方案,我尝试过用豆瓣( http://pypi.douban.com/simple) 以及清华的源,但是都不行。

 

 最后我在odoo的群里问,有位朋友回复说需要安装gcc,于是我先安装gcc

 yum -y install gcc gcc-c++ kernel-devel
    
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirror.sjtu.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Package gcc-4.8.5-44.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.8.5-44.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-44.el7 for package: gcc-c++-4.8.5-44.el7.x86_64
--> Processing Dependency: libstdc++ = 4.8.5-44.el7 for package: gcc-c++-4.8.5-44.el7.x86_64
---> Package kernel-devel.x86_64 0:3.10.0-1160.11.1.el7 will be installed
--> Running transaction check
---> Package libstdc++.x86_64 0:4.8.5-39.el7 will be updated
---> Package libstdc++.x86_64 0:4.8.5-44.el7 will be an update
---> Package libstdc++-devel.x86_64 0:4.8.5-39.el7 will be updated
--> Processing Dependency: libstdc++-devel = 4.8.5-39.el7 for package: libstdc++-static-4.8.5-39.el7.x86_64
---> Package libstdc++-devel.x86_64 0:4.8.5-44.el7 will be an update
--> Running transaction check
---> Package libstdc++-static.x86_64 0:4.8.5-39.el7 will be updated
---> Package libstdc++-static.x86_64 0:4.8.5-44.el7 will be an update
--> Finished Dependency Resolution

 安装完成之后,我继续尝试安装psutil,

 python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn psutil

仍然报刚才的错误。

 

 最后,我感觉快走投无路的时候,网上查了一下有可能是python3-devel没有安装(

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值