<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python 操作系统 Ubuntu on 日日是好日-我的生活记录</title>
    <link>http://www.ririshihaori.com:80/tags/python-%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-ubuntu/</link>
    <description>Recent content in Python 操作系统 Ubuntu on 日日是好日-我的生活记录</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Tue, 26 Nov 2019 00:23:55 +0800</lastBuildDate>
    <atom:link href="http://www.ririshihaori.com:80/tags/python-%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-ubuntu/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Ubuntu16.04升级Python3.7</title>
      <link>http://www.ririshihaori.com:80/posts/2019/11/ubuntu%E5%8D%87%E7%BA%A7python/</link>
      <pubDate>Tue, 26 Nov 2019 00:23:55 +0800</pubDate>
      <guid>http://www.ririshihaori.com:80/posts/2019/11/ubuntu%E5%8D%87%E7%BA%A7python/</guid>
      <description>&lt;p&gt;Ubuntu16.04默认带的Python是2.7.12和3.5，升级到Python3.7的步骤如下：&lt;/p&gt;&#xA;&lt;p&gt;第一步，增加ppa仓库:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo add-apt-repository ppa:jonathonf/python-3.7&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;第二步，升级apt索引，更新python:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo apt-get update&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo apt-get install python3.7&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;第三步，更换系统默认的软链命令Python3到新的Python3.7:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;最后，update-alternatives命令可以修改系统默认命令的软链指向，通过以下命令，可以切换Python3的指向:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$sudo update-alternatives --config python3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;查看python2 和 python3的版本:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$python2 --version&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$python3 --verison&lt;/code&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
