{"id":257126,"date":"2022-12-10T08:22:03","date_gmt":"2022-12-10T00:22:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=257126"},"modified":"2022-11-14T22:48:12","modified_gmt":"2022-11-14T14:48:12","slug":"how-linux-python","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/how-linux-python.html","title":{"rendered":"\u5982\u4f55\u5728Linux \u4e2d\u5b89\u88c5 Python 3.10"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8ba1\u5212\u4e3a\u5de5\u4f5c\u5b89\u88c5 Python 3.10\uff1f\u4ee5\u4e0b\u662f\u5728 Ubuntu \u548c\u76f8\u5173\u53d1\u884c\u7248\u4e2d\u5b89\u88c5 Python 3.10 \u7684\u65b9\u6cd5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Python 3.10 \u4e8e 2021 \u5e74 10 \u6708 25 \u65e5\u53d1\u5e03\uff0c\u5177\u6709\u9644\u52a0\u529f\u80fd\u548c\u66f4\u65b0\u3002\u6b64\u7248\u672c\u5e26\u6765\u4e86\u66f4\u597d\u7684\u9519\u8bef\u6d88\u606f\u5904\u7406\u3001\u65b0\u7684\u6a21\u5f0f\u5339\u914d\u529f\u80fd\u3001\u7c7b\u578b\u522b\u540d(TypeAlias)\u3001\u7528\u6237\u5b9a\u4e49\u7684\u7c7b\u578b\u4fdd\u62a4\u7b49\u3002\u4f60\u53ef\u4ee5\u5728 docs.python.org \u9605\u8bfb\u53d1\u5e03\u91cd\u70b9\u3002<\/p>\n

\u5728\u7f16\u5199\u672c\u6307\u5357\u65f6\uff0c\u5927\u591a\u6570\u5f53\u524d\u53d1\u884c\u7248\u90fd\u91c7\u7528 Python 3.10\u3002\u4f8b\u5982\uff0cUbuntu 22.04 LTS \u548c Fedora 36 \u9ed8\u8ba4\u90fd\u6709 Python 3.10\u3002<\/p>\n

\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4f60\u73b0\u5728\u5728\u4efb\u4f55\u4e0d\u652f\u6301\u7684\u7248\u672c\u4e2d\u9700\u8981 Python 3.10\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 github.com \u5728 Ubuntu \u4e2d\u5b89\u88c5\u6700\u65b0\u7684 Python 3.10\u3002\u4e0b\u9762\u662f\u65b9\u6cd5\u3002<\/p>\n

\u5982\u4f55\u5728 Ubuntu \u4e0a\u5b89\u88c5 Python 3.10<\/strong><\/div>\n

\u6b64 PPA \u53ef\u7528\u4e8e Ubuntu 21.10\u3001Ubuntu 21.04\u3001Ubuntu 20.04 LTS\u3001Ubuntu 18.04 LTS \u548c Linux Mint 20.x\u3001Elementary OS 6 \u548c\u5176\u4ed6\u76f8\u5173\u7684\u57fa\u4e8e Ubuntu \u7684\u53d1\u884c\u7248\u3002\u8fd9\u4e9b\u53d1\u884c\u7248\u5927\u591a\u6570\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u652f\u6301 3.10\u3002<\/p>\n

\u6253\u5f00\u7ec8\u7aef\u5e76\u6dfb\u52a0\u4ee5\u4e0b PPA\uff1a<\/p>\n

sudo add-apt-repository ppa:deadsnakes\/ppa<\/pre>\n

\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5237\u65b0\u7f13\u5b58\uff1a<\/p>\n

sudo apt update<\/pre>\n

\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 Python 3.10\uff1a<\/p>\n

sudo apt install python3.10<\/pre>\n
\u8bbe\u7f6e Python \u7248\u672c<\/strong><\/div>\n

\u5c06 Python 3.10 \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u503c\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u6b65\u9aa4\u3002\u5982\u4e0b\u3002<\/p>\n

\u8b66\u544a\uff1a\u4f60\u7684 Ubuntu \u7cfb\u7edf\u4e2d\u7684\u8bb8\u591a\u5e94\u7528\u7a0b\u5e8f\u4f9d\u8d56\u4e8e Python 3.9 \u7684\u5e93\u5b58\u7248\u672c\u3002\u56e0\u6b64\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684\u5de5\u4f5c\u5e94\u7528\uff08\u4f8b\u5982 GIMP\u3001GNOME \u7ec8\u7aef\u7b49\uff09\u4e0e Python 3.10 \u517c\u5bb9\u3002\u6240\u4ee5\uff0c\u8981\u5c0f\u5fc3\u3002<\/p>\n

\u5feb\u901f\u63d0\u793a\uff1a \u5982\u679c\u8981\u68c0\u67e5\u5df2\u5b89\u88c5\u7684\u7cfb\u7edf\u5305\u4e2d\u7684\u54ea\u4e9b\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7248\u672c\uff0c\u8bf7\u4f7f\u7528apt-cache\u547d\u4ee4\u7684rdepends\u5f00\u5173\u3002\u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u68c0\u67e5\u54ea\u4e9b\u5df2\u5b89\u88c5\u7684\u5305\u4f9d\u8d56\u4e8e Python 3.8\u3002<\/p>\n

apt-cache rdepends python3.8\r\n[~]$ apt-cache rdepends python3.8\r\npython3.8\r\nReverse Depends:\r\npython3.8-dbg\r\nvirtualbox\r\npython3.8-venv\r\npython3.8-full\r\nlibpython3.8-testsuite\r\nlibglib2.0-tests\r\nidle-python3.8\r\nidle-python3.8\r\npython3.8-minimal\r\npython3.8-doc\r\npython3.8-dev\r\npython3.8-dbg\r\npython3-uno\r\ngedit\r\nvirtualbox\r\nstimfit\r\npython3.8-venv\r\npython3-stfio\r\npython3-escript-mpi\r\npython3-escript\r\npython3-csound\r\npitivi\r\nobs-studio\r\nliferea\r\nlibpython3.8-testsuite\r\nlibglib2.0-tests\r\nkitty\r\nkdevelop-python\r\nidle-python3.8\r\nidle-python3.8\r\nrhythmbox-plugins\r\npython3.8-minimal\r\npython3.8-doc\r\npython3.8-dev\r\npython3\r\npython3-uno\r\npython3-all\r\ncluster-glue\r\ngedit\r\n[~]$<\/pre>\n
\u4f7f\u7528 Python 3.10 \u4f5c\u4e3a\u9ed8\u8ba4 Python3<\/strong><\/div>\n

\u9996\u5148\uff0c\u4f7f\u7528\u7ec8\u7aef\u4e2d\u7684\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u5f53\u524d\u9ed8\u8ba4\u7248\u672c\u3002<\/p>\n

python3 --version<\/pre>\n

\u4f7f\u7528update-alternatives\u521b\u5efa\u6307\u5411python3\u7684\u7b26\u53f7\u94fe\u63a5\u3002<\/p>\n

sudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.9 1\r\nsudo update-alternatives --install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.10 2<\/pre>\n

\u5e76\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9009\u62e9\u4f7f\u7528\u54ea\u4e00\u4e2a\u4f5c\u4e3apython3\uff1a<\/p>\n

sudo update-alternatives --config python3<\/pre>\n

\u8fd9\u5c31\u662f\u6240\u6709\u6b65\u9aa4\u3002\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u5f00\u59cb\u5728\u5f53\u524d\u7684 Ubuntu \u7248\u672c\u4e2d\u4f7f\u7528\u6700\u65b0\u7684 Python \u8fdb\u884c\u5de5\u4f5c\/\u5b66\u4e60\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u5207\u6362\u5230\u5e93\u5b58\u7248\u672c\u5e76\u5728\u4efb\u4f55\u65f6\u95f4\u66f4\u6539\u7248\u672c\u53f7\u3002<\/p>\n


\n

via: https:\/\/linux.cn\/lctt\/geekpi<\/a>
\n\u4f5c\u8005\uff1a \u8bd1\u8005\uff1a\u6821\u5bf9\uff1a
\n\u672c\u6587\u7531
LCTT<\/a> \u539f\u521b\u7ffb\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

Python 3.10 \u4e8e 2021 \u5e74 10 \u6708 25 \u65e5\u53d1\u5e03\uff0c\u5177\u6709\u9644\u52a0\u529f\u80fd\u548c\u66f4\u65b0\u3002\u6b64\u7248\u672c\u5e26\u6765\u4e86\u66f4\u597d\u7684\u9519\u8bef\u6d88 […]<\/p>\n","protected":false},"author":310,"featured_media":257158,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-257126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=257126"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257126\/revisions"}],"predecessor-version":[{"id":261444,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257126\/revisions\/261444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/257158"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=257126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=257126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=257126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}