python学习笔记1——安装python,,python学习笔记


python学习笔记1——安装python


centos和ubuntu的python2.7的安装方法参考:http://daixuan.blog.51cto.com/5426657/1767325


1、查看当前python版本并且

[[email protected]~]#python-VPython2.6.6

2、安装eple-release扩展源

[[email protected]~]#yuminstall-yepel-release

3、安装pip

[[email protected]~]#yuminstallpython-pip

4、安装ipython(因为系统python版本是2.6.6,所以安装ipthon1.2.1与其兼容)

[[email protected]~]#pipinstallipython==1.2.1

源码安装,到网站上下载ipython-1.2.1.tar.gz

tar -zxvfipython-1.2.1.tar.gz

cdipython-1.2.1

python setup.py install


注:如果不指定版本,会到网站上下载最新版本:https://pypi.python.org/pypi/ipython

[[email protected]~]#yuminstall-ypython-pip//这样安装会有问题[[email protected]~]#pipinstallipython//默认安装的是ipython-4.2.0,python2.6不能使用[[email protected]~]#ipythonTraceback(mostrecentcalllast):File"/usr/bin/ipython",line7,in<module>fromIPythonimportstart_ipythonFile"/usr/lib/python2.6/site-packages/IPython/__init__.py",line34,in<module>raiseImportError(‘IPythonrequiresPythonversion2.7or3.3orabove.‘)ImportError:IPythonrequiresPythonversion2.7or3.3orabove.


4、测试ipython的自动补全功能

[[email protected]~]#ipythonPython2.6.6(r266:84292,Jul232015,15:22:56)Type"copyright","credits"or"license"formoreinformation.IPython1.2.1--AnenhancedInteractivePython.?->IntroductionandoverviewofIPython‘sfeatures.%quickref->Quickreference.help->Python‘sownhelpsystem.object?->Detailsabout‘object‘,use‘object??‘forextradetails.In[1]:print2+46

本文出自 “梅花香自苦寒来!” 博客,请务必保留此出处http://daixuan.blog.51cto.com/5426657/1771895

python学习笔记1——安装python

相关内容

    暂无相关文章

评论关闭