更新數據源爲國內,是爲了加速安裝包的增長速度。css
安裝pip3:sudo apt-get install python3-pippython
升級pip3:sudo pip3 install --upgrade pipubuntu
查看pip版本:pip -Vvim
點擊「i」鍵,進入編輯模式,複製信息:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
這個更換的是清華的源,清華的源5分鐘同步官網一次,建議使用。
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
阿里雲 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/阿里雲
點擊:「ESC」切換到命令行模式,輸入「:wq」保存離開。url
咱們也能夠把Ubuntu的默認python版本號進行修改,步驟以下:命令行
一、刪除原有Python鏈接文件code
sudo rm /usr/bin/pythonip
二、切換成root帳戶,創建指向Python3的鏈接get
切換root帳戶:sudo -s
創建執行Python3的鏈接
ln -s /usr/bin/python3.6 /usr/bin/python
以上操做就是完成默認Python版本號設置,使用:python -V查看默認版本號.