Centos6.5安裝python2.7.5+pip
1.下載包
$ wget --no-check-certificate
2.到下載目錄,解壓
$ tar -xvf Python-2.7.5.tar.bz2
3.新建資料夾作為安裝路徑
$ mkdir /usr/local/python27
4.在解壓後的路徑下,編譯安裝
$ cd Python-2.7.5.tar.xz
$ ./configure --prefix=/usr/local/python27
$ make
$ make install
5.此時將舊版本更改為別名
$ mv /usr/bin/python /usr/bin/python2.6.6
6.再建立新版本python的連結
$ ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
7.此時,輸入python,就會顯示最新的版本資訊
Python 2.7.5 (default, Jan 15 2017, 13:56:08)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
8.此時用pip,會提示command not found
pip官網提示如果已經是2.7.9以上的版本會自帶pip,當時沒有注意看是否bin目錄有pip,就草率的重新再下載了一份get_pip.py,如
果進入目錄看到有pip(完整的目錄是/usr/local/python27/bin),可以跳過第9,10步
9.下載get_pip.py
$ wget --no-check-certificate
不加--no-check-certificate會提示證照錯誤
10.執行pip,會將pip,setuptools,wheel都安裝好
$ python get_pip.py
等待完成就好了,此時還不能用
11.然後建立連結
$ ln -s /usr/local/python27/bin/pip2.7 /usr/bin/pip
我本地顯示有pip,pip2,pip2.7,我將最新的建立了連結
12.輸入pip,顯示Uage,這樣就搞定了
$ pip
補充:
vim /usr/bin/yum
#!/usr/bin/python2.6.6
vim /etc/profile
export PYTHON_HOME=/usr/bin/python2.6.6
export PATH=$PYTHON_HOME/bin:$PATH
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2132450/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS6.5安裝pipCentOS
- CentOS6.5 安裝opensslCentOS
- CentOS6.5安裝ScrapyCentOS
- Centos6.5 Docker安裝CentOSDocker
- centos6.5安裝gitCentOSGit
- CentOS6.5安裝MongoDBCentOSMongoDB
- CentOS6.5安裝RHBaseCentOS
- CentOS6.5安裝RHiveCentOSHive
- CentOS6.5下安裝mongodbCentOSMongoDB
- CentOS6.5安裝VMware ToolsCentOS
- CentOS6.5安裝RHadoopCentOSHadoop
- Centos6.5 IPython安裝CentOSPython
- CentOS6.5安裝sqlite3CentOSSQLite
- CentOS6.5安裝ElasticSearch6.2.3CentOSElasticsearch
- CentOS6.5 安裝Zookeeper叢集CentOS
- CentOS6.5安裝Elasticsearch5.3.0CentOSElasticsearchH5
- centos6.5下安裝配置hudsonCentOS
- centos6.5安裝php5.6.0CentOSPHP
- 在Centos6.5上安裝ossfsCentOS
- CentOS6.5安裝JDK1.8CentOSJDK
- CentOS6.5安裝Maven3.2.5CentOSMaven
- CentOS6.5安裝Elasticsearch1.7.5CentOSElasticsearch
- CentOS6.5安裝Twemproxy叢集CentOS
- CentOS6.5 安裝Storm叢集CentOSORM
- CentOS6.5 安裝Kafka叢集CentOSKafka
- CentOS6.5 安裝Spark叢集CentOSSpark
- centos6.5上安裝mysql 5.7.20CentOSMySql
- CentOS6.5安裝python3.7CentOSPython
- CentOS6.5安裝Kibana5.3.0CentOS
- centos6.5上安裝discuzX3.3CentOS
- CentOS6.5安裝nginx1.20CentOSNginx
- CentOS6.5上安裝MySQL5.6CentOSMySql
- CentOS6.5安裝Tomcat8.0CentOSTomcat
- CentOS6.5安裝Redis資料庫CentOSRedis資料庫
- CentOS6.5下安裝Open vSwitchCentOS
- CentOS6.5安裝sqoop2CentOSOOP
- CentOS6.5安裝zookeeper-3.4.5(單機)CentOS
- CentOS6.5下MySQL5.6的安裝CentOSMySql