日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Ubuntu16.04安裝Python3.6及安裝過程中錯(cuò)誤解決

系統(tǒng) 2559 0

Ubuntu16.04默認(rèn)安裝了Python2.7和3.5

請(qǐng)注意,系統(tǒng)自帶的python千萬不能卸載!

輸入命令python

Ubuntu16.04安裝Python3.6及安裝過程中錯(cuò)誤解決_第1張圖片

按Ctrl+D退出python命令行

Ubuntu16.04安裝Python3.6及安裝過程中錯(cuò)誤解決_第2張圖片

輸入命令sudo add-apt-repository ppa:jonathonf/python-3.6

復(fù)制代碼

            Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success
'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli;
 then appstreamcli refresh > /dev/null;
 fi'
E: Sub-process returned an error code
          

復(fù)制代碼

在運(yùn)行sudo apt-get update時(shí)出現(xiàn)如上信息,解決方法如下:

            sudo pkill -KILL appstreamcli
          
            wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
          
            sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
          

執(zhí)行完上述命令之后再次運(yùn)行sudo apt-get update就不會(huì)再出現(xiàn)上面的錯(cuò)誤。

Ubuntu16.04安裝Python3.6及安裝過程中錯(cuò)誤解決_第3張圖片

按Enter確認(rèn)

輸入命令sudo apt-get update

輸入命令sudo apt-get install python3.6

按Y確認(rèn)

?

調(diào)整Python3的優(yōu)先級(jí),使得3.6優(yōu)先級(jí)較高

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

更改默認(rèn)值,python默認(rèn)為Python2,現(xiàn)在修改為Python3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

?

此時(shí)再輸入命令python

Ubuntu16.04安裝Python3.6及安裝過程中錯(cuò)誤解決_第4張圖片

可以看到此時(shí)已經(jīng)是Python3.6了


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 德格县| 浠水县| 汾阳市| 梧州市| 南昌市| 天柱县| 天镇县| 吴旗县| 合阳县| 绵竹市| 治多县| 赤城县| 临沧市| 色达县| 南安市| 分宜县| 牡丹江市| 建平县| 达拉特旗| 东光县| 济源市| 鸡泽县| 钦州市| 府谷县| 大同县| 鸡东县| 息烽县| 安国市| 马鞍山市| 南和县| 疏附县| 宜丰县| 台南市| 三门县| 龙海市| 朔州市| 阳城县| 盐池县| 读书| 开阳县| 建阳市|