1.研究python-nltk时,需要安装numpy。
采用下面的命令安装失败: $sudo pip install -U numpy ...
File "numpy/core/setup.py", line 410, in generate_config_hmoredefs, 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 searchyum search numpy
============================== 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