直接安裝 apt-get install python3.6 ,失敗
root@91d2d47e8aee:/# apt-get install python3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'
E: Couldn't find any package by regex 'python3.6'
繼續(xù)安裝:
步驟1:添加ppa到系統(tǒng)
add-apt-repository ppa:jonathonf/python-3.6
失敗员舵,問題:add-apt-repository找不到
解決辦法:
執(zhí)行下面兩個(gè)步驟:
apt-get install python-software-properties
apt-get install software-properties-common
Ubuntu無法找到add-apt-repository問題的解決方法
重復(fù)步驟1:
add-apt-repository ppa:jonathonf/python-3.6
步驟2 更新:
apt-get update
步驟3 安裝:
apt-get install python3.6
安裝完成O瞥薄毅访!
修改python命令默認(rèn)python3.6:
ubuntu默認(rèn)安裝了python2.7,輸入python 、 python3、 python3.6依次得到如下版本:
修改python命令默認(rèn)python3.6
步驟1: 查看python命令指向:
ls -l /usr/bin | grep python
可以看到python命令指向python2.7版本
步驟2: 刪除原有python軟連接
rm /usr/bin/python
步驟3: 建立python到python3.6新的軟鏈接
ln -s /usr/bin/python3.6 /usr/bin/python
ubuntu 安裝pip
直接安裝python3版本pip
apt-get install python3-pip
安裝完成后哄啄,建立pip到pip3的軟連接。
ln -s /usr/bin/pip3 /usr/bin/pip