红联Linux门户
Linux帮助

pip和yum的某种内在联系

发布时间:2016-05-19 10:02:23来源:linux网站作者:libaishen1991

由于学业需要,开始接触linux,选择了centos6.5。


1.机器学习中,我用Python,学习了如何进行数据处理,期间,需要使用matplotlib进行绘图处理,结果:

#pip install matplotlib显示:

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /root/.pip/pip.log


2.又安装pandas

#pip install pandas,显示:

Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ModyBS-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/matplotlib
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/local/python27/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/usr/local/python27/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 105: ordinal not in range(128)


3.网上搜索,说和python版本有关,因为centos6.5自带python2.6,我自己下载编译了python2.7,并且用python2.7编译安装了pip1.5,所以我才matplotlib默认需要python2.6来编译的缘故。


4.于是有搜到可以yum安装,

# yum install python-matplotlib -y

结果可以用,并且使用python2.6可以import matplotlib

而用自己装的2.7却找不到。


本文永久更新地址:http://www.linuxdiyf.com/linux/20766.html