注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

God is U 做自己的上帝

富原孤島--只发优质级的文章

 
 
 

日志

 
 

Python pip error: command 'gcc' failed with exit status 1的解决方案  

2015-06-24 15:05:53|  分类: [LINUX] |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
在[root@VCTCNDSZ01ITDSG include]#  python -m pip install psutil
报以下错:
  compilation terminated.
  error: command 'gcc' failed with exit status 1 
  ----------------------------------------
  Failed building wheel for psutil


如下解决:
[root@VCTCNDSZ01ITDSG include]# yum search python-dev
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.pubyun.com
 * extras: mirrors.pubyun.com
 * updates: centos.ustc.edu.cn
====================================== N/S matched: python-dev ======================================
dbus-python-devel.i686 : Libraries and headers for dbus-python
dbus-python-devel.x86_64 : Libraries and headers for dbus-python
gstreamer-python-devel.i686 : Headers for developing programs that will use gstreamer-python
gstreamer-python-devel.x86_64 : Headers for developing programs that will use gstreamer-python
python-devel.x86_64 : The libraries and header files needed for Python development

  Name and summary matches only, use "search all" for everything.
[root@VCTCNDSZ01ITDSG include]# yum install python-devel.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.pubyun.com
 * extras: mirrors.pubyun.com
 * updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package python-devel.x86_64 0:2.7.5-16.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================
 Package                    Arch                 Version                    Repository          Size
=====================================================================================================
Installing:
 python-devel               x86_64               2.7.5-16.el7               base               388 k

Transaction Summary
=====================================================================================================
Install  1 Package

Total download size: 388 k
Installed size: 1.0 M
Is this ok [y/d/N]: y
Downloading packages:
python-devel-2.7.5-16.el7.x86_64.rpm                                          | 388 kB  00:00:01    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python-devel-2.7.5-16.el7.x86_64                                                  1/1
  Verifying  : python-devel-2.7.5-16.el7.x86_64                                                  1/1

Installed:
  python-devel.x86_64 0:2.7.5-16.el7                                                                

Complete!

[root@VCTCNDSZ01ITDSG include]#  python -m pip install psutil
Collecting psutil
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached psutil-3.0.1.tar.gz
Building wheels for collected packages: psutil
  Running setup.py bdist_wheel for psutil
  Stored in directory: /root/.cache/pip/wheels/a1/ee/ae/67e3aca118756cd874c47a201fc5dd01ea137b6dd658d4f742
Successfully built psutil
Installing collected packages: psutil
Successfully installed psutil-3.0.1
[root@VCTCNDSZ01ITDSG include]#

测试:(IDLE下)
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> import psutil
>>> psutil.cpu_times()
scputimes(user=26425.62, nice=41.31, system=4070.79, idle=207597.06, iowait=1104.8, irq=1.2, softirq=22.21, steal=0.0, guest=0.0, guest_nice=0.0)
>>>
  评论这张
 
阅读(309)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017