{"id":298,"date":"2019-07-21T22:09:16","date_gmt":"2019-07-21T14:09:16","guid":{"rendered":"https:\/\/harson.co\/?p=298"},"modified":"2020-05-22T16:38:04","modified_gmt":"2020-05-22T08:38:04","slug":"py2py3-coexist-in-windows","status":"publish","type":"post","link":"https:\/\/harson.co\/index.php\/2019\/07\/21\/py2py3-coexist-in-windows\/","title":{"rendered":"Py2&#038;Py3 coexist"},"content":{"rendered":"<h1>CentOS<\/h1>\n<p>CentOS\u9ed8\u8ba4\u5df2\u81ea\u5e26Python2\u73af\u5883\uff0c\u8fd9\u91cc\u8865\u5145Python3\u73af\u5883\u5b89\u88c5<\/p>\n<p>\u5b89\u88c5\u4f9d\u8d56<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make<\/code><\/pre>\n<p>\u4e0b\u8f7d\u6e90\u7801<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">wget https:\/\/www.python.org\/ftp\/python\/3.7.0\/Python-3.7.0.tgz<\/code><\/pre>\n<p>\u7f16\u8bd1\u5b89\u88c5<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">tar -xzvf Python-3.7.0.tgz\r\ncd Python-3.7.0\r\n.\/configure prefix=\/usr\/local\/python3\r\nmake &amp;&amp; make install<\/code><\/pre>\n<p>\u8bbe\u7f6e\u8f6f\u94fe\u63a5<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">ln -s \/usr\/local\/python3\/bin\/python3 \/usr\/bin\/python3\r\nln -s \/usr\/local\/python3\/bin\/pip3 \/usr\/bin\/pip3<\/code><\/pre>\n<h1>Windows<\/h1>\n<p>Python3 \u4f5c\u4e3a\u5e38\u7528\u7248\u672c\uff0c\u6b63\u5e38\u5b89\u88c5\uff0c\u6dfb\u52a0\u9ed8\u8ba4\u8def\u5f84\u81f3\u73af\u5883\u53d8\u91cf<\/p>\n<p>\u5728Python2\u7684\u5b89\u88c5\u76ee\u5f55(C:\\Python27)\uff0c\u987b\u540c\u65f6\u6709\uff08\u901a\u8fc7\u62f7\u8d1d\u540e\u91cd\u547d\u540d\uff09<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">python.exe\r\npython2.exe\r\npythonw.exe\r\npythonw2.exe<\/code><\/pre>\n<p>\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u5982\u4e0b<\/p>\n<p>C:\\Python27;C:\\Python\\Scripts;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS CentOS\u9ed8\u8ba4\u5df2\u81ea\u5e26Python2\u73af\u5883\uff0c\u8fd9\u91cc\u8865\u5145Python3\u73af\u5883\u5b89\u88c5 \u5b89\u88c5\u4f9d\u8d56 yum in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-298","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":5,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":491,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/298\/revisions\/491"}],"wp:attachment":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/media?parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/categories?post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/tags?post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}