{"id":1110535,"date":"2025-01-08T17:20:37","date_gmt":"2025-01-08T09:20:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1110535.html"},"modified":"2025-01-08T17:20:39","modified_gmt":"2025-01-08T09:20:39","slug":"python%e5%a6%82%e4%bd%95%e5%9c%a8%e6%89%8b%e6%9c%ba%e4%b8%8a%e4%b8%8b%e8%bd%bd%e6%a8%a1%e5%9d%97-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1110535.html","title":{"rendered":"python\u5982\u4f55\u5728\u624b\u673a\u4e0a\u4e0b\u8f7d\u6a21\u5757"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25073335\/4134bfa6-a0c2-4dd2-846c-a6cff2261c1c.webp\" alt=\"python\u5982\u4f55\u5728\u624b\u673a\u4e0a\u4e0b\u8f7d\u6a21\u5757\" \/><\/p>\n<p><p> <strong>\u5728\u624b\u673a\u4e0a\u4e0b\u8f7dPython\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u3001\u4f7f\u7528Termux\u3001\u501f\u52a9Pydroid\u7b49\u65b9\u6cd5\u3002<\/strong>\u5176\u4e2d\uff0c<strong>\u4f7f\u7528Termux<\/strong>\u662f\u4e00\u79cd\u8f83\u4e3a\u5e38\u89c1\u4e14\u65b9\u4fbf\u7684\u65b9\u6cd5\u3002Termux\u662f\u4e00\u4e2aAndroid\u4e0a\u7684\u7ec8\u7aef\u4eff\u771f\u5668\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u5728\u624b\u673a\u4e0a\u8fd0\u884cLinux\u73af\u5883\uff0c\u4ece\u800c\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u548c\u5b89\u88c5Python\u6a21\u5757\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7Termux\u5728\u624b\u673a\u4e0a\u4e0b\u8f7dPython\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Termux\u5b89\u88c5Python\u6a21\u5757<\/h3>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5Termux<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u4eceGoogle Play\u5546\u5e97\u6216\u5176\u4ed6\u53ef\u4fe1\u6765\u6e90\u4e0b\u8f7d\u5e76\u5b89\u88c5Termux\u5e94\u7528\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Termux\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u66f4\u65b0\u548c\u5347\u7ea7\u8f6f\u4ef6\u5305<\/h4>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u9996\u5148\u66f4\u65b0\u548c\u5347\u7ea7\u8f6f\u4ef6\u5305\uff0c\u4ee5\u786e\u4fdd\u5b89\u88c5\u7684\u6240\u6709\u8f6f\u4ef6\u90fd\u662f\u6700\u65b0\u7248\u672c\u3002\u8fd0\u884c\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><h4>3\u3001\u5b89\u88c5Python<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u5b89\u88c5Python\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pkg install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5b89\u88c5Python 3\u7684\u6700\u65b0\u7248\u672c\u3002<\/p>\n<\/p>\n<p><h4>4\u3001\u5b89\u88c5pip<\/h4>\n<\/p>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5305\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pkg install python-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>5\u3001\u5b89\u88c5Python\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u73b0\u5728\u4f60\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\u4efb\u4f55Python\u6a21\u5757\u3002\u4f8b\u5982\uff0c\u8981\u5b89\u88c5numpy\u6a21\u5757\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u540c\u7406\uff0c\u4f60\u53ef\u4ee5\u5b89\u88c5\u5176\u4ed6\u4efb\u4f55\u4f60\u9700\u8981\u7684Python\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Pydroid\u5b89\u88c5Python\u6a21\u5757<\/h3>\n<\/p>\n<p><p>Pydroid\u662f\u4e00\u4e2aAndroid\u4e0a\u7684Python IDE\uff0c\u53ef\u4ee5\u8ba9\u7528\u6237\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u4ee3\u7801\u5e76\u5b89\u88c5\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5Pydroid<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4eceGoogle Play\u5546\u5e97\u4e0b\u8f7d\u5e76\u5b89\u88c5Pydroid\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u6253\u5f00Pydroid\u5e76\u8fdb\u5165\u7ec8\u7aef<\/h4>\n<\/p>\n<p><p>\u6253\u5f00Pydroid\u5e94\u7528\uff0c\u7136\u540e\u70b9\u51fb\u5de6\u4fa7\u83dc\u5355\u4e2d\u7684\u7ec8\u7aef\u9009\u9879\uff0c\u8fdb\u5165Pydroid\u7684\u7ec8\u7aef\u754c\u9762\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528pip\u5b89\u88c5\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u5728Pydroid\u7684\u7ec8\u7aef\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Python\u6a21\u5757\u3002\u4f8b\u5982\uff0c\u5b89\u88c5requests\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528QPython\u5b89\u88c5Python\u6a21\u5757<\/h3>\n<\/p>\n<p><p>QPython\u662f\u53e6\u4e00\u4e2aAndroid\u4e0a\u7684Python IDE\uff0c\u5b83\u4e5f\u63d0\u4f9b\u4e86\u5b89\u88c5Python\u6a21\u5757\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5QPython<\/h4>\n<\/p>\n<p><p>\u4eceGoogle Play\u5546\u5e97\u4e0b\u8f7d\u5e76\u5b89\u88c5QPython\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u6253\u5f00QPython\u5e76\u8fdb\u5165\u7ec8\u7aef<\/h4>\n<\/p>\n<p><p>\u6253\u5f00QPython\u5e94\u7528\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u83dc\u5355\u6309\u94ae\uff0c\u9009\u62e9\u201c\u7ec8\u7aef\u201d\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528pip\u5b89\u88c5\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u5728QPython\u7684\u7ec8\u7aef\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Python\u6a21\u5757\u3002\u4f8b\u5982\uff0c\u5b89\u88c5pandas\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u5931\u8d25<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5\u67d0\u4e2a\u6a21\u5757\u65f6\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\uff0c\u786e\u4fdd\u624b\u673a\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4e92\u8054\u7f51\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0pip\u5230\u6700\u65b0\u7248\u672c\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install --upgrade pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u95ee\u9898\u4f9d\u7136\u5b58\u5728\uff0c\u53ef\u4ee5\u641c\u7d22\u76f8\u5173\u9519\u8bef\u4fe1\u606f\uff0c\u67e5\u770b\u662f\u5426\u6709\u5176\u4ed6\u7528\u6237\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h4>2\u3001\u6a21\u5757\u7248\u672c\u95ee\u9898<\/h4>\n<\/p>\n<p><p>\u6709\u4e9b\u6a21\u5757\u53ef\u80fd\u9700\u8981\u7279\u5b9a\u7248\u672c\u7684Python\u6216\u5176\u4ed6\u4f9d\u8d56\u5e93\u3002\u5982\u679c\u9047\u5230\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684\u6a21\u5757\u3002\u4f8b\u5982\uff0c\u8981\u5b89\u88c5numpy\u7684\u7279\u5b9a\u7248\u672c\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy==1.19.5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5728\u624b\u673a\u4e0a\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u624b\u673a\u4e0a\u5b89\u88c5\u597dPython\u6a21\u5757\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Termux\u3001Pydroid\u6216QPython\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528Termux\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684nano\u7f16\u8f91\u5668\u6216\u5176\u4ed6\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u4f7f\u7528nano\u7f16\u5199\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">nano my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7f16\u5199\u5b8c\u4ee3\u7801\u540e\uff0c\u4fdd\u5b58\u5e76\u9000\u51fanano\u7f16\u8f91\u5668\uff0c\u7136\u540e\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528Pydroid\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5728Pydroid\u4e2d\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728IDE\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528QPython\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5728QPython\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728IDE\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u8fd0\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u624b\u673a\u4e0a\u4e0b\u8f7d\u548c\u5b89\u88c5Python\u6a21\u5757\u5e76\u4e0d\u590d\u6742\uff0c\u4f7f\u7528Termux\u3001Pydroid\u6216QPython\u7b49\u5de5\u5177\u90fd\u53ef\u4ee5\u8f7b\u677e\u5b8c\u6210\u3002\u901a\u8fc7\u8fd9\u4e9b\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u73af\u5883\uff0c\u7f16\u5199\u548c\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u6781\u5927\u5730\u65b9\u4fbf\u4e86\u79fb\u52a8\u5f00\u53d1\u548c\u5b66\u4e60\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u5728\u624b\u673a\u4e0a\u4f7f\u7528Python\u3002\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u5efa\u8bae\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u624b\u673a\u4e0a\u4f7f\u7528Python\u4e0b\u8f7d\u6a21\u5757\uff1f<\/strong><br \/>\u5728\u624b\u673a\u4e0a\u4f7f\u7528Python\u4e0b\u8f7d\u6a21\u5757\u7684\u65b9\u5f0f\u6709\u5f88\u591a\uff0c\u901a\u5e38\u5efa\u8bae\u4f7f\u7528\u4e00\u4e2a\u5408\u9002\u7684Python IDE\u6216\u7ec8\u7aef\u6a21\u62df\u5668\u5e94\u7528\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4e0b\u8f7dPydroid 3\u6216QPython\u7b49\u5e94\u7528\uff0c\u8fd9\u4e9b\u5e94\u7528\u5141\u8bb8\u60a8\u5728Android\u8bbe\u5907\u4e0a\u6267\u884cPython\u4ee3\u7801\u5e76\u5b89\u88c5\u6a21\u5757\u3002\u6253\u5f00\u5e94\u7528\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u6765\u4e0b\u8f7d\u6240\u9700\u7684\u6a21\u5757\uff0c\u53ea\u9700\u5728\u7ec8\u7aef\u8f93\u5165<code>pip install \u6a21\u5757\u540d<\/code>\u5373\u53ef\u3002<\/p>\n<p><strong>\u5728\u624b\u673a\u4e0a\u4e0b\u8f7dPython\u6a21\u5757\u65f6\u662f\u5426\u9700\u8981\u7f51\u7edc\u8fde\u63a5\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u4e0b\u8f7dPython\u6a21\u5757\u901a\u5e38\u9700\u8981\u7a33\u5b9a\u7684\u7f51\u7edc\u8fde\u63a5\u3002\u56e0\u4e3a\u6a21\u5757\u901a\u5e38\u662f\u4ecePython\u7684\u5b98\u65b9\u5e93\uff08\u5982PyPI\uff09\u4e2d\u4e0b\u8f7d\u7684\uff0c\u786e\u4fdd\u60a8\u7684\u624b\u673a\u8fde\u63a5\u5230\u4e92\u8054\u7f51\u53ef\u4ee5\u987a\u5229\u5b8c\u6210\u4e0b\u8f7d\u548c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u4f7f\u7528\u624b\u673a\u4e0b\u8f7dPython\u6a21\u5757\u662f\u5426\u6709\u4efb\u4f55\u9650\u5236\uff1f<\/strong><br \/>\u5728\u624b\u673a\u4e0a\u4e0b\u8f7dPython\u6a21\u5757\u53ef\u80fd\u4f1a\u53d7\u5230\u4e00\u4e9b\u9650\u5236\uff0c\u6bd4\u5982\u8bbe\u5907\u6027\u80fd\u548c\u53ef\u7528\u5b58\u50a8\u7a7a\u95f4\u3002\u67d0\u4e9b\u5927\u578b\u6a21\u5757\u53ef\u80fd\u4f1a\u5bf9\u8d44\u6e90\u8981\u6c42\u8f83\u9ad8\uff0c\u4ece\u800c\u5f71\u54cd\u624b\u673a\u7684\u8fd0\u884c\u6548\u7387\u3002\u6b64\u5916\uff0c\u67d0\u4e9b\u6a21\u5757\u53ef\u80fd\u4e0d\u5b8c\u5168\u517c\u5bb9\u624b\u673a\u7684Python\u73af\u5883\uff0c\u56e0\u6b64\u5728\u9009\u62e9\u6a21\u5757\u65f6\uff0c\u5efa\u8bae\u67e5\u770b\u5176\u6587\u6863\u4ee5\u786e\u8ba4\u517c\u5bb9\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u624b\u673a\u4e0a\u4e0b\u8f7dPython\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u3001\u4f7f\u7528Termux\u3001\u501f\u52a9Pydroid\u7b49\u65b9\u6cd5\u3002\u5176\u4e2d\uff0c\u4f7f\u7528Termu [&hellip;]","protected":false},"author":3,"featured_media":1110543,"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\/1110535"}],"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=1110535"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1110535\/revisions"}],"predecessor-version":[{"id":1110545,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1110535\/revisions\/1110545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1110543"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1110535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1110535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1110535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}