{"id":953717,"date":"2024-12-27T01:46:52","date_gmt":"2024-12-26T17:46:52","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/953717.html"},"modified":"2024-12-27T01:46:54","modified_gmt":"2024-12-26T17:46:54","slug":"%e5%8d%8e%e4%b8%ba%e5%b9%b3%e6%9d%bf%e5%a6%82%e4%bd%95%e4%b8%8b%e8%bd%bdpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/953717.html","title":{"rendered":"\u534e\u4e3a\u5e73\u677f\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\/25094127\/f6f5ea2f-924d-4d3e-b16a-565e54c1ffd8.webp\" alt=\"\u534e\u4e3a\u5e73\u677f\u5982\u4f55\u4e0b\u8f7dpython\" \/><\/p>\n<p><p> <strong>\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u4e0b\u8f7dPython\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u9014\u5f84\uff1a\u4f7f\u7528Termux\u3001\u4f7f\u7528Pydroid 3\u3001\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eePython.org\u7f51\u7ad9\u3002<\/strong>\u5176\u4e2d\uff0c<strong>\u4f7f\u7528Termux<\/strong>\u662f\u4e00\u4e2a\u975e\u5e38\u7075\u6d3b\u4e14\u529f\u80fd\u5f3a\u5927\u7684\u9009\u62e9\uff0c\u53ef\u4ee5\u6a21\u62dfLinux\u7ec8\u7aef\u73af\u5883\uff0c\u5141\u8bb8\u4f60\u76f4\u63a5\u5728\u5e73\u677f\u4e0a\u4f7f\u7528\u547d\u4ee4\u884c\u5b89\u88c5Python\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Termux\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u4e0b\u8f7d\u548c\u5b89\u88c5Python\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528Termux\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>Termux\u662f\u4e00\u4e2aAndroid\u7ec8\u7aef\u6a21\u62df\u5668\u548cLinux\u73af\u5883\u5e94\u7528\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684Linux\u73af\u5883\uff0c\u53ef\u4ee5\u901a\u8fc7apt\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u548c\u7ba1\u7406\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Termux<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u6253\u5f00AppGallery\u6216\u5176\u4ed6\u5e94\u7528\u5546\u5e97\uff0c\u641c\u7d22\u5e76\u4e0b\u8f7dTermux\u5e94\u7528\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Termux\u5e94\u7528\uff0c\u4f60\u5c06\u770b\u5230\u4e00\u4e2a\u547d\u4ee4\u884c\u754c\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u66f4\u65b0\u548c\u5347\u7ea7\u8f6f\u4ef6\u5305<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Termux\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u66f4\u65b0\u548c\u5347\u7ea7\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\uff0c\u4ee5\u786e\u4fdd\u83b7\u53d6\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pkg update<\/p>\n<p>pkg upgrade<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u66f4\u65b0Termux\u5185\u6240\u6709\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pkg install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u53ef\u4ee5\u542f\u52a8Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u8ba4Python\u5b89\u88c5\u6210\u529f\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u8fd4\u56dePython\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660ePython\u5df2\u6210\u529f\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528Pydroid 3\u5b89\u88c5Python<\/p>\n<\/p>\n<p><p>Pydroid 3\u662f\u4e00\u6b3eAndroid\u5e94\u7528\uff0c\u4e13\u4e3aPython\u7f16\u7a0b\u8bbe\u8ba1\uff0c\u5177\u6709\u7b80\u5355\u6613\u7528\u7684\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u9002\u5408\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Pydroid 3<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u534e\u4e3a\u5e73\u677f\u7684\u5e94\u7528\u5546\u5e97\u4e2d\u641c\u7d22\u5e76\u4e0b\u8f7dPydroid 3\u5e94\u7528\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Pydroid 3\uff0c\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u7b80\u5355\u7684Python IDE\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5f00\u59cb\u4f7f\u7528Python<\/strong><\/p>\n<\/p>\n<p><p>Pydroid 3\u5185\u7f6e\u4e86Python\u73af\u5883\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5Python\u3002\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u7f16\u8f91\u5668\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u201c\u8fd0\u884c\u201d\u6309\u94ae\u6267\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u5176\u4ed6Python\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5b89\u88c5\u5176\u4ed6Python\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7Pydroid 3\u5185\u7f6e\u7684pip\u5de5\u5177\u8fdb\u884c\u5b89\u88c5\u3002\u5728Pydroid 3\u7684\u7ec8\u7aef\u754c\u9762\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install library_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06<code>library_name<\/code>\u66ff\u6362\u4e3a\u4f60\u9700\u8981\u7684\u5e93\u540d\u79f0\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eePython.org\u7f51\u7ad9<\/p>\n<\/p>\n<p><p>\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u76f4\u63a5\u5b89\u88c5Python\u5230\u8bbe\u5907\u4e0a\uff0c\u4f46\u53ef\u4ee5\u83b7\u5f97Python\u7684\u76f8\u5173\u8d44\u6e90\u548c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00\u534e\u4e3a\u5e73\u677f\u4e0a\u7684\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"https:\/\/www.python.org\/%E3%80%82\">https:\/\/www.python.org\/\u3002<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7dPython<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b98\u7f51\u4e2d\uff0c\u53ef\u4ee5\u627e\u5230Python\u7684\u5404\u4e2a\u7248\u672c\u4e0b\u8f7d\u94fe\u63a5\uff0c\u5c3d\u7ba1Android\u8bbe\u5907\u4e0a\u65e0\u6cd5\u76f4\u63a5\u5b89\u88c5\u8fd9\u4e9b\u7248\u672c\uff0c\u4f46\u4f60\u53ef\u4ee5\u5b66\u4e60\u5230Python\u7684\u4f7f\u7528\u6587\u6863\u548c\u6559\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u5728\u7ebfIDE<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5728\u7ebf\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u7f51\u7ad9\u4e0a\u6216\u5176\u4ed6\u5e73\u53f0\u63d0\u4f9b\u7684\u5728\u7ebfIDE\u4e5f\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u4e0b\u8f7d\u548c\u4f7f\u7528Python\u7684\u65b9\u5f0f\u6709\u591a\u79cd\u9009\u62e9\uff0c<strong>\u4f7f\u7528Termux<\/strong>\u662f\u6700\u4e3a\u5168\u9762\u548c\u7075\u6d3b\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6a21\u62df\u4e00\u4e2a\u5b8c\u6574\u7684Linux\u73af\u5883\uff0c\u9002\u5408\u6709\u4e00\u5b9a\u6280\u672f\u80cc\u666f\u7684\u7528\u6237\uff1b<strong>\u4f7f\u7528Pydroid 3<\/strong>\u5219\u66f4\u52a0\u7b80\u5355\u76f4\u89c2\uff0c\u9002\u5408\u521d\u5b66\u8005\u548c\u666e\u901a\u7528\u6237\u3002\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u8f7b\u677e\u5f00\u59cbPython\u7f16\u7a0b\uff0c\u63d0\u9ad8\u7f16\u7a0b\u6280\u80fd\u548c\u6548\u7387\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u548c\u4e60\u60ef\u8fdb\u884c\u8c03\u6574\uff0c\u83b7\u5f97\u6700\u4f73\u7684\u7f16\u7a0b\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u534e\u4e3a\u5e73\u677f\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u65b9\u6cd5\u4e0b\u8f7d\u548c\u5b89\u88c5Python\uff1f<\/strong><br \/>\u534e\u4e3a\u5e73\u677f\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u4e0b\u8f7d\u548c\u5b89\u88c5Python\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u4e13\u95e8\u7684\u5e94\u7528\u7a0b\u5e8f\u5546\u5e97\uff0c\u6bd4\u5982\u534e\u4e3a\u5e94\u7528\u5e02\u573a\uff0c\u641c\u7d22\u76f8\u5173\u7684Python\u7f16\u7a0b\u5e94\u7528\u3002\u6b64\u5916\uff0c\u7528\u6237\u8fd8\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u5408Android\u7cfb\u7edf\u7684Python\u5e94\u7528\uff0c\u5982Pydroid 3\u7b49\u3002\u4f7f\u7528\u8fd9\u4e9b\u5e94\u7528\uff0c\u53ef\u4ee5\u5728\u5e73\u677f\u4e0a\u8fdb\u884cPython\u7f16\u7a0b\u548c\u5b66\u4e60\u3002<\/p>\n<p><strong>\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u8fd0\u884cPython\u4ee3\u7801\u6709\u4ec0\u4e48\u9650\u5236\u5417\uff1f<\/strong><br \/>\u867d\u7136\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u53ef\u4ee5\u5b89\u88c5Python\u5e94\u7528\uff0c\u4f46\u8fd0\u884c\u4ee3\u7801\u65f6\u53ef\u80fd\u4f1a\u9762\u4e34\u4e00\u4e9b\u9650\u5236\u3002\u79fb\u52a8\u8bbe\u5907\u7684\u5904\u7406\u80fd\u529b\u76f8\u5bf9\u8f83\u4f4e\uff0c\u590d\u6742\u7684\u7a0b\u5e8f\u53ef\u80fd\u8fd0\u884c\u4e0d\u7545\u3002\u6b64\u5916\uff0c\u67d0\u4e9bPython\u5e93\u53ef\u80fd\u4e0d\u517c\u5bb9\u4e8e\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f71\u54cd\u7279\u5b9a\u529f\u80fd\u7684\u5b9e\u73b0\u3002\u56e0\u6b64\uff0c\u5efa\u8bae\u7528\u6237\u5728\u7f16\u5199\u548c\u6d4b\u8bd5\u4ee3\u7801\u65f6\uff0c\u5c3d\u91cf\u9009\u62e9\u8f7b\u91cf\u7ea7\u7684\u9879\u76ee\u3002<\/p>\n<p><strong>\u4f7f\u7528\u534e\u4e3a\u5e73\u677f\u8fdb\u884cPython\u7f16\u7a0b\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u8fdb\u884cPython\u7f16\u7a0b\u65f6\uff0c\u7528\u6237\u5e94\u6ce8\u610f\u5c4f\u5e55\u5c3a\u5bf8\u548c\u8f93\u5165\u65b9\u5f0f\u3002\u7531\u4e8e\u5e73\u677f\u7684\u5c4f\u5e55\u8f83\u5c0f\uff0c\u7f16\u5199\u4ee3\u7801\u65f6\u53ef\u80fd\u4f1a\u611f\u5230\u4e0d\u4fbf\uff0c\u5efa\u8bae\u4f7f\u7528\u5916\u63a5\u952e\u76d8\u4ee5\u63d0\u9ad8\u8f93\u5165\u6548\u7387\u3002\u540c\u65f6\uff0c\u786e\u4fdd\u5b9a\u671f\u4fdd\u5b58\u4ee3\u7801\uff0c\u4ee5\u9632\u6b62\u610f\u5916\u4e22\u5931\u3002\u6b64\u5916\uff0c\u4e86\u89e3\u79fb\u52a8\u8bbe\u5907\u7684\u5185\u5b58\u548c\u5b58\u50a8\u9650\u5236\u4e5f\u5f88\u91cd\u8981\uff0c\u4ee5\u4f18\u5316\u7a0b\u5e8f\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u534e\u4e3a\u5e73\u677f\u4e0a\u4e0b\u8f7dPython\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u9014\u5f84\uff1a\u4f7f\u7528Termux\u3001\u4f7f\u7528Pydroid 3\u3001\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee [&hellip;]","protected":false},"author":3,"featured_media":953722,"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\/953717"}],"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=953717"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953717\/revisions"}],"predecessor-version":[{"id":953724,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953717\/revisions\/953724"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/953722"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=953717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=953717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=953717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}