{"id":945669,"date":"2024-12-26T23:28:11","date_gmt":"2024-12-26T15:28:11","guid":{"rendered":""},"modified":"2024-12-26T23:28:13","modified_gmt":"2024-12-26T15:28:13","slug":"deepin%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bdpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/945669.html","title":{"rendered":"deepin\u5982\u4f55\u4e0b\u8f7dpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082140\/a0941d70-2f45-4d13-a2d7-3b1bfc344aa2.webp\" alt=\"deepin\u5982\u4f55\u4e0b\u8f7dpython\" \/><\/p>\n<p><p> \u4e00\u3001deepin\u4e0b\u8f7dPython\u7684\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u5728deepin\u7cfb\u7edf\u4e2d\u4e0b\u8f7dPython\uff0c\u53ef\u4ee5\u901a\u8fc7<strong>\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\u3001\u76f4\u63a5\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u3001\u4f7f\u7528Pyenv\u5de5\u5177\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c<\/strong>\u7b49\u591a\u79cd\u65b9\u5f0f\u3002\u63a8\u8350\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\uff0c\u56e0\u4e3a\u5b83\u80fd\u591f\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u4e14\u66f4\u65b0\u6bd4\u8f83\u65b9\u4fbf\u3002\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668<\/strong>\uff1a\u5728deepin\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528APT\u5305\u7ba1\u7406\u5de5\u5177\u6765\u5b89\u88c5Python\u3002\u9996\u5148\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\uff1a<code>sudo apt update<\/code>\u3002\u63a5\u4e0b\u6765\uff0c\u8f93\u5165<code>sudo apt install python3<\/code>\u547d\u4ee4\u6765\u5b89\u88c5Python 3\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305<\/strong>\uff1a\u5982\u679c\u9700\u8981\u7279\u5b9a\u7248\u672c\u7684Python\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\u4e0b\u8f7d\u6e90\u7801\u5305\u5e76\u81ea\u884c\u7f16\u8bd1\u5b89\u88c5\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u89e3\u538b\u6e90\u7801\u5305\uff0c\u7136\u540e\u8fdb\u5165\u89e3\u538b\u540e\u7684\u76ee\u5f55\uff0c\u8fd0\u884c<code>.\/configure<\/code>\uff0c\u63a5\u7740\u4f9d\u6b21\u8fd0\u884c<code>make<\/code>\u548c<code>sudo make install<\/code>\u547d\u4ee4\u5373\u53ef\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Pyenv\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c<\/strong>\uff1aPyenv\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u7684\u5de5\u5177\uff0c\u9002\u5408\u4e8e\u9700\u8981\u5728\u540c\u4e00\u7cfb\u7edf\u4e0a\u4f7f\u7528\u4e0d\u540cPython\u7248\u672c\u7684\u7528\u6237\u3002\u9996\u5148\uff0c\u901a\u8fc7GitHub\u4e0a\u7684\u5b98\u65b9\u4ed3\u5e93\u5b89\u88c5Pyenv\uff0c\u7136\u540e\u901a\u8fc7Pyenv\u547d\u4ee4\u6765\u5b89\u88c5\u548c\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684Python\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u79cd\u65b9\u6cd5\u7684\u5177\u4f53\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528APT\u5305\u7ba1\u7406\u5668\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>APT\uff08Advanced Package Tool\uff09\u662fDebian\u53ca\u5176\u884d\u751f\u53d1\u884c\u7248\uff08\u5982Ubuntu\u3001deepin\u7b49\uff09\u4e0a\u5e38\u7528\u7684\u5305\u7ba1\u7406\u5de5\u5177\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u65b9\u4fbf\u5feb\u6377\u7684\u65b9\u6cd5\u6765\u5b89\u88c5\u548c\u7ba1\u7406\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u5b89\u88c5Python\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u66f4\u65b0\u7cfb\u7edf\u7684\u8f6f\u4ef6\u5305\u5217\u8868\uff0c\u4ee5\u786e\u4fdd\u80fd\u591f\u83b7\u53d6\u5230\u6700\u65b0\u7684\u8f6f\u4ef6\u5305\u7248\u672c\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt update<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4ece\u8f6f\u4ef6\u6e90\u670d\u52a1\u5668\u4e0a\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u4fe1\u606f\uff0c\u5e76\u66f4\u65b0\u5230\u672c\u5730\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5b89\u88c5Python 3<\/strong><\/li>\n<\/ol>\n<p><p>deepin\u7cfb\u7edf\u4e2d\u9ed8\u8ba4\u7684Python\u7248\u672c\u901a\u5e38\u8f83\u65e7\uff0c\u56e0\u6b64\u6211\u4eec\u63a8\u8350\u5b89\u88c5Python 3\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Python 3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6761\u547d\u4ee4\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5Python 3\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u5305\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5b89\u88c5pip<\/strong><\/li>\n<\/ol>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b89\u88c5Python 3\u65f6\u4f1a\u540c\u65f6\u5b89\u88c5pip\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pip3<\/code>\u547d\u4ee4\u6765\u5b89\u88c5Python\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305<\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684Python\uff0c\u6216\u8005\u5e0c\u671b\u624b\u52a8\u7f16\u8bd1\u5b89\u88c5\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u4e0b\u8f7d\u6e90\u7801\u5305<\/strong><\/li>\n<\/ol>\n<p><p>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%EF%BC%8C%E5%9C%A8%E2%80%9CDownloads%E2%80%9D%E9%A1%B5%E9%9D%A2%E4%B8%AD%E6%89%BE%E5%88%B0%E9%9C%80%E8%A6%81%E7%9A%84Python%E7%89%88%E6%9C%AC%EF%BC%8C%E7%84%B6%E5%90%8E%E4%B8%8B%E8%BD%BD%E6%BA%90%E7%A0%81%E5%8C%85%EF%BC%88%E9%80%9A%E5%B8%B8%E4%BB%A5%60.tgz%60%E6%88%96%60.tar.xz%60%E4%B8%BA%E5%90%8E%E7%BC%80%EF%BC%89%E3%80%82\">https:\/\/www.python.org\/\uff09\uff0c\u5728\u201cDownloads\u201d\u9875\u9762\u4e2d\u627e\u5230\u9700\u8981\u7684Python\u7248\u672c\uff0c\u7136\u540e\u4e0b\u8f7d\u6e90\u7801\u5305\uff08\u901a\u5e38\u4ee5`.tgz`\u6216`.tar.xz`\u4e3a\u540e\u7f00\uff09\u3002<\/a><\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u89e3\u538b\u6e90\u7801\u5305<\/strong><\/li>\n<\/ol>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b\u6e90\u7801\u5305\uff08\u5047\u8bbe\u6587\u4ef6\u540d\u4e3a<code>Python-3.x.x.tgz<\/code>\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">tar -xzf Python-3.x.x.tgz<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u7f16\u8bd1\u5b89\u88c5<\/strong><\/li>\n<\/ol>\n<p><p>\u8fdb\u5165\u89e3\u538b\u540e\u7684\u76ee\u5f55\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">cd Python-3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6e\u7f16\u8bd1\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">.\/configure --enable-optimizations<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0a\u9762\u7684<code>--enable-optimizations<\/code>\u9009\u9879\u7528\u4e8e\u542f\u7528\u4f18\u5316\u7f16\u8bd1\uff0c\u4ee5\u63d0\u9ad8Python\u7684\u8fd0\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\u548c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">make<\/p>\n<p>sudo make install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7f16\u8bd1\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528Pyenv\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c<\/p>\n<\/p>\n<p><p>Pyenv\u662f\u4e00\u4e2a\u7528\u4e8e\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u7684\u5de5\u5177\uff0c\u7279\u522b\u9002\u5408\u9700\u8981\u5728\u540c\u4e00\u7cfb\u7edf\u4e0a\u4f7f\u7528\u4e0d\u540cPython\u7248\u672c\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5Pyenv<\/strong><\/li>\n<\/ol>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5\u4ee5\u4e0b\u4f9d\u8d56\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install -y make build-essential libssl-dev zlib1g-dev \\<\/p>\n<p>libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \\<\/p>\n<p>libncurses5-dev libncursesw5-dev xz-utils tk-dev<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Pyenv\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">curl https:\/\/pyenv.run | bash<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6309\u7167\u63d0\u793a\u5c06Pyenv\u6dfb\u52a0\u5230shell\u7684\u521d\u59cb\u5316\u6587\u4ef6\u4e2d\uff08\u5982<code>~\/.bashrc<\/code>\u6216<code>~\/.zshrc<\/code>\uff09\uff0c\u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source ~\/.bashrc<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5b89\u88c5Python\u7248\u672c<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528Pyenv\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684Python\u975e\u5e38\u7b80\u5355\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv install 3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06<code>3.x.x<\/code>\u66ff\u6362\u4e3a\u9700\u8981\u7684Python\u7248\u672c\u53f7\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\u5168\u5c40\u4f7f\u7528\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv global 3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c<\/strong><\/li>\n<\/ol>\n<p><p>Pyenv\u5141\u8bb8\u5728\u4e0d\u540c\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e3a\u5f53\u524d\u76ee\u5f55\u8bbe\u7f6e\u7279\u5b9a\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv local 3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\uff0c\u5f53\u5728\u8be5\u76ee\u5f55\u4e0b\u8fd0\u884cPython\u65f6\uff0c\u5c06\u4f1a\u4f7f\u7528\u6307\u5b9a\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<ol>\n<li><strong>\u68c0\u67e5Python\u7248\u672c<\/strong><\/li>\n<\/ol>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\u4f7f\u7528Pyenv\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u865a\u62df\u73af\u5883<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u5f00\u53d1Python\u9879\u76ee\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\uff08virtual environment\uff09\u6765\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\u3002\u53ef\u4ee5\u4f7f\u7528Python\u81ea\u5e26\u7684<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u4f9d\u8d56\u5305\uff0c\u4e0d\u4f1a\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u5728deepin\u7cfb\u7edf\u4e2d\u6210\u529f\u5b89\u88c5\u548c\u7ba1\u7406Python\uff0c\u5e76\u6839\u636e\u9700\u8981\u9009\u62e9\u6700\u9002\u5408\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u662f\u4f7f\u7528\u7cfb\u7edf\u5305\u7ba1\u7406\u5668\u7684\u7b80\u5355\u4fbf\u6377\uff0c\u8fd8\u662f\u901a\u8fc7Pyenv\u7684\u7075\u6d3b\u591a\u6837\uff0c\u90fd\u80fd\u6ee1\u8db3\u4e0d\u540c\u7528\u6237\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Deepin\u7cfb\u7edf\u4e2d\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728Deepin\u7cfb\u7edf\u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5Python\u3002\u6253\u5f00\u7ec8\u7aef\u540e\uff0c\u8f93\u5165\u547d\u4ee4<code>sudo apt update<\/code>\u6765\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\uff0c\u7136\u540e\u8f93\u5165<code>sudo apt install python3<\/code>\u6765\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python 3\u3002\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165<code>python3 --version<\/code>\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<p><strong>Deepin\u81ea\u5e26\u7684Python\u7248\u672c\u662f\u591a\u5c11\uff1f<\/strong><br \/>Deepin\u7cfb\u7edf\u901a\u5e38\u9884\u88c5\u4e86Python\uff0c\u4f46\u5177\u4f53\u7248\u672c\u53ef\u80fd\u4f1a\u56e0\u4e0d\u540c\u7684Deepin\u7248\u672c\u800c\u5f02\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python3 --version<\/code>\u6765\u67e5\u770b\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u5982\u679c\u9700\u8981\u66f4\u9ad8\u7248\u672c\uff0c\u53ef\u4ee5\u8003\u8651\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u624b\u52a8\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Deepin\u4e2d\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\uff1f<\/strong><br \/>\u5728Deepin\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pyenv<\/code>\u6765\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002\u901a\u8fc7\u7ec8\u7aef\u5b89\u88c5<code>pyenv<\/code>\uff0c\u7136\u540e\u4f7f\u7528<code>pyenv install &lt;version&gt;<\/code>\u547d\u4ee4\u6765\u5b89\u88c5\u6240\u9700\u7248\u672c\u3002\u6b64\u5de5\u5177\u5141\u8bb8\u7528\u6237\u8f7b\u677e\u5207\u6362\u548c\u7ba1\u7406\u4e0d\u540c\u7684Python\u73af\u5883\uff0c\u9002\u5408\u9700\u8981\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u7248\u672c\u7684\u5f00\u53d1\u8005\u3002<\/p>\n<p><strong>\u5728Deepin\u4e2d\u5982\u4f55\u5b89\u88c5Python\u5e93\uff1f<\/strong><br \/>\u7528\u6237\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u6765\u5b89\u88c5Python\u5e93\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>pip install &lt;\u5e93\u540d&gt;<\/code>\u5373\u53ef\u5b89\u88c5\u6240\u9700\u5e93\u3002\u5982\u679c\u672a\u5b89\u88c5<code>pip<\/code>\uff0c\u53ef\u4ee5\u5148\u901a\u8fc7\u547d\u4ee4<code>sudo apt install python3-pip<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u7528\u6237\u53ef\u4ee5\u7ba1\u7406\u548c\u66f4\u65b0Python\u5e93\uff0c\u786e\u4fdd\u5f00\u53d1\u73af\u5883\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001deepin\u4e0b\u8f7dPython\u7684\u65b9\u6cd5 \u5728deepin\u7cfb\u7edf\u4e2d\u4e0b\u8f7dPython\uff0c\u53ef\u4ee5\u901a\u8fc7\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\u3001\u76f4\u63a5 [&hellip;]","protected":false},"author":3,"featured_media":945676,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/945669"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=945669"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/945669\/revisions"}],"predecessor-version":[{"id":945680,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/945669\/revisions\/945680"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/945676"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=945669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=945669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=945669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}