安装python numpy

1.研究python-nltk时,需要安装numpy。 

采用下面的命令安装失败: $sudo pip install -U numpy ... 

  File "numpy/core/setup.py", line 410, in generate_config_h 
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)   File "numpy/core/setup.py", line 41, in check_types     out = check_types(*a, **kw) 
  File "numpy/core/setup.py", line 271, in check_types     "Cannot compile 'Python.h'. Perhaps you need to "\ 
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel. ---------------------------------------- 

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/numpy Storing complete log in /root/.pip/pip.log  


解决方法: 

可以通过gui安装:system>administration>add/remove software>search numpy and install it. 

也可以试试用sudo yum install numpy安装。  

yum search 

yum search numpy 


Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile  * base: mirrors.btte.net  * extras: mirrors.btte.net  * updates: mirrors.btte.net 
============================== N/S Matched: numpy ============================== numpy-f2py.x86_64 : f2py for numpy 
numpy.x86_64 : A fast multidimensional array facility for Python  

  Name and summary matches only, use "search all" for everything.


2.安装python模块时出现:error: Setup script exited with error: command 'gcc' failed with exit status 1

yum install python-devel

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值