[教學] CentOS6.5 x64 同時安裝Python 2&3

需求:新增Python3.5到主機裡,並與2.7版共存

要能夠使用pip

 

開始施工:

1.下載最新版的python3

wget http://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz

2.解壓縮&安裝

tar –zxvf Python-3.5.2.tgz

cd Python-3.5.2

./configure --prefix=/usr/local/python3

make && make install

3.設定python3 link

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

4.測試python3有無正確安裝

python3 –V && pip3 –V

5.升級pip

pip3 install --upgrade pip

收工


參考資料:

1.知乎:同時裝了Python3和Python2,怎麼用pip?