{"id":121,"date":"2019-12-27T11:36:48","date_gmt":"2019-12-27T03:36:48","guid":{"rendered":"https:\/\/washingpatrick.cn\/?p=121"},"modified":"2019-12-27T13:40:51","modified_gmt":"2019-12-27T05:40:51","slug":"how-to-install-python-3-8-1-in-ubuntu-16-04-tls-with-python-2-7-alive","status":"publish","type":"post","link":"https:\/\/washingpatrick.cn\/index.php\/2019\/12\/27\/how-to-install-python-3-8-1-in-ubuntu-16-04-tls-with-python-2-7-alive\/","title":{"rendered":"How to install Python 3.8.1 in Ubuntu 16.04 LTS with Python 2.7 alive"},"content":{"rendered":"<h2>Hi Python 3.8.<\/h2>\n<p>Here is \u94bf\u94bf<br \/>\nI'm here to share how to install Python 3.8.1 with Ubuntu 16.04 LTS.<\/p>\n<h3>0. Start<\/h3>\n<p>At first, I just want to build a server for remote. I've tried Windows server 2019, but I can't active it with colleage KMS. So there is a strange Ubuntu server come out.<br \/>\n<img decoding=\"async\" src=\"https:\/\/washingpatrick.cn\/wp-content\/uploads\/2019\/12\/2019-12-26_15-03-06-300x130.png\" alt=\"\" \/><br \/>\nHowever, system comes with Python 2.7.2 and 3.5.2, which I'm plan to update it.<\/p>\n<h3>1. Ready<\/h3>\n<p>First of all, <strong>PLEASE<\/strong> update your apt source list:<\/p>\n<pre><code class=\"language-bash\">sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n<p>For somehow, there is some optional applications for build, I prefer to use them:<\/p>\n<ul>\n<li>Aria2: For faster download\n<pre><code class=\"language-bash\">sudo apt-get install aria2<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>Let's start with download source code<\/h4>\n<p>Download from <a href=\"https:\/\/www.python.org\/downloads\/release\/python-381\/\">python.org<\/a><\/p>\n<pre><code class=\"language-bash\">aria2c -x 8 https:\/\/www.python.org\/ftp\/python\/3.8.1\/Python-3.8.1.tgz<\/code><\/pre>\n<p>or<\/p>\n<pre><code class=\"language-bash\">wget https:\/\/www.python.org\/ftp\/python\/3.8.1\/Python-3.8.1.tgz<\/code><\/pre>\n<h4>Install requirement<\/h4>\n<p>For this part, follow may not completly, please install additional with error message.<\/p>\n<pre><code class=\"language-bash\">sudo apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev<\/code><\/pre>\n<h3>2. Install<\/h3>\n<p>After download Python-3.8.1.tgz, you can install now!<\/p>\n<h4>a. Unzip file<\/h4>\n<pre><code class=\"language-bash\">tar -xvf Python-3.8.1.tgz<\/code><\/pre>\n<h4>b. Change folder<\/h4>\n<pre><code class=\"language-bash\">cd Python-3.8.1.tgz<\/code><\/pre>\n<h4>c. Generate makeFile<\/h4>\n<pre><code class=\"language-bash\">.\/configure<\/code><\/pre>\n<h4>d. Make<\/h4>\n<pre><code class=\"language-bash\"># j is process thread, big is better(depends on your CPU )\nsudo make -j4<\/code><\/pre>\n<h4>e. Install to bin<\/h4>\n<pre><code class=\"language-bash\">sudo make install<\/code><\/pre>\n<p>Then you will get Python 3.8.1<\/p>\n<h3>3. Pypi go!<\/h3>\n<p>Here is a simple guide for install Pypi with mutiple version Python.<\/p>\n<ul>\n<li>For Python 2.7:\n<pre><code class=\"language-bash\">wget https:\/\/bootstrap.pypa.io\/get-pip.py\nsudo python get-pip.py<\/code><\/pre>\n<\/li>\n<li>For Python 3.8:\n<pre><code class=\"language-bash\">sudo apt-get install python3-pip\nsudo ln -s \/usr\/local\/bin\/pip3.8 \/usr\/local\/bin\/pip3<\/code><\/pre>\n<\/li>\n<\/ul>\n<p><strong>PLZ DO NOT USE PSM.<\/strong> This will mix up Pip3 &amp; Pip source<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Python 3.8. Here is \u94bf\u94bf I&#8217;m here to share how to inst&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/washingpatrick.cn\/index.php\/2019\/12\/27\/how-to-install-python-3-8-1-in-ubuntu-16-04-tls-with-python-2-7-alive\/\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[16,19,17,14,13,15,18],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-python","tag-16-04","tag-2-7","tag-install","tag-python","tag-python-3-8-1","tag-ubuntu","tag-update"],"_links":{"self":[{"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":10,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/posts\/121\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/washingpatrick.cn\/index.php\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}