{"id":1016487,"date":"2024-12-27T12:16:55","date_gmt":"2024-12-27T04:16:55","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1016487.html"},"modified":"2024-12-27T12:16:57","modified_gmt":"2024-12-27T04:16:57","slug":"python%e4%b8%8b%e5%a6%82%e4%bd%95%e6%89%a7%e8%a1%8c%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1016487.html","title":{"rendered":"python\u4e0b\u5982\u4f55\u6267\u884c\u5b89\u88c5"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100015\/aa55db57-4cd6-40bc-a343-69c1a569092a.webp\" alt=\"python\u4e0b\u5982\u4f55\u6267\u884c\u5b89\u88c5\" \/><\/p>\n<p><p> \u5f00\u5934\u6bb5\u843d\uff1a<br \/>\u5728Python\u73af\u5883\u4e0b\u6267\u884c\u5b89\u88c5\u901a\u5e38\u6d89\u53ca\u5230\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u4ee5\u53ca\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u7b49\u6b65\u9aa4\u3002<strong>\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u4f7f\u7528pip\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56<\/strong>\uff0c\u8fd9\u4e9b\u90fd\u662fPython\u5f00\u53d1\u4e2d\u5e38\u89c1\u7684\u64cd\u4f5c\u3002\u5176\u4e2d\uff0c\u4f7f\u7528pip\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u662f\u6700\u4e3a\u5e38\u7528\u7684\uff0c\u56e0\u4e3apip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u652f\u6301\u4ecePython Package Index\uff08PyPI\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00\uff0c\u638c\u63e1\u5982\u4f55\u4f7f\u7528pip\u7ba1\u7406\u5e93\u662f\u9ad8\u6548\u5f00\u53d1\u7684\u91cd\u8981\u6280\u80fd\u3002\u901a\u8fc7pip\uff0c\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f7b\u677e\u5730\u5b89\u88c5\u3001\u5347\u7ea7\u548c\u5378\u8f7dPython\u5e93\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<code>pip install package_name<\/code>\u6765\u5b89\u88c5\u67d0\u4e2a\u5e93\uff0c<code>pip install --upgrade package_name<\/code>\u6765\u5347\u7ea7\u5e93\uff0c\u6216\u4f7f\u7528<code>pip uninstall package_name<\/code>\u6765\u5378\u8f7d\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python\u89e3\u91ca\u5668  <\/p>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4f7f\u7528Python\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u5148\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002Python\u89e3\u91ca\u5668\u662fPython\u7a0b\u5e8f\u8fd0\u884c\u65f6\u6240\u9700\u7684\u6838\u5fc3\u7ec4\u4ef6\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7dPython\u5b89\u88c5\u5305<\/strong><br \/>\u9996\u5148\uff0c\u60a8\u9700\u8981\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u5b89\u88c5\u5305\u3002Python\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86\u9002\u7528\u4e8eWindows\u3001macOS\u548c\u5404\u79cdLinux\u53d1\u884c\u7248\u7684\u5b89\u88c5\u5305\u3002\u901a\u5e38\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e0a\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u4e0b\u8f7d\u7684<code>.exe<\/code>\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u9009\u4e2d\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Python\u3002\u5728macOS\u548cLinux\u7cfb\u7edf\u4e0a\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6765\u5b89\u88c5Python\uff0c\u4f8b\u5982\u901a\u8fc7Homebrew\u6216apt-get\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u5e76\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u9a8c\u8bc1Python\u662f\u5426\u5df2\u6b63\u786e\u5b89\u88c5\u3002\u5982\u679c\u60a8\u770b\u5230Python\u7684\u7248\u672c\u4fe1\u606f\uff0c\u90a3\u4e48\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528pip\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93  <\/p>\n<\/p>\n<p><p>pip\u662fPython\u5185\u7f6e\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5305\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5pip<\/strong><br \/>\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u73b0\u4ee3Python\u7248\u672c\u81ea\u5e26pip\u3002\u5982\u679c\u60a8\u7684Python\u7248\u672c\u4e2d\u6ca1\u6709pip\uff0c\u60a8\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d<code>get-pip.py<\/code>\u811a\u672c\uff0c\u5e76\u4f7f\u7528\u547d\u4ee4<code>python get-pip.py<\/code>\u6765\u5b89\u88c5pip\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python\u5305<\/strong><br \/>\u4f7f\u7528pip\u5b89\u88c5Python\u5305\u975e\u5e38\u7b80\u5355\u3002\u60a8\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pip install package_name<\/code>\u5373\u53ef\u3002\u4f8b\u5982\uff0c\u5b89\u88c5NumPy\u5e93\u7684\u547d\u4ee4\u662f<code>pip install numpy<\/code>\u3002pip\u4f1a\u81ea\u52a8\u4ecePyPI\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6307\u5b9a\u7684\u5305\u53ca\u5176\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5347\u7ea7\u548c\u5378\u8f7d\u5305<\/strong><br \/>pip\u540c\u6837\u652f\u6301\u5347\u7ea7\u548c\u5378\u8f7d\u5305\u3002\u4f7f\u7528<code>pip install --upgrade package_name<\/code>\u53ef\u4ee5\u5347\u7ea7\u5305\u5230\u6700\u65b0\u7248\u672c\uff0c\u800c\u4f7f\u7528<code>pip uninstall package_name<\/code>\u53ef\u4ee5\u5378\u8f7d\u4e0d\u9700\u8981\u7684\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf  <\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u662f\u4e3a\u4e86\u786e\u4fddPython\u548cpip\u547d\u4ee4\u5728\u7ec8\u7aef\u4e2d\u53ef\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbe\u7f6ePATH\u73af\u5883\u53d8\u91cf<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027\u201d-&gt;\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d-&gt;\u201c\u73af\u5883\u53d8\u91cf\u201d\u6765\u8bbe\u7f6ePATH\u3002\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u6dfb\u52a0Python\u5b89\u88c5\u8def\u5f84\u548cScripts\u6587\u4ef6\u5939\u8def\u5f84\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Python\u548cpip\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/strong><br \/>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u91cd\u65b0\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\u5e76\u8f93\u5165<code>python<\/code>\u6216<code>pip<\/code>\u6765\u68c0\u67e5\u547d\u4ee4\u662f\u5426\u53ef\u7528\u3002\u5982\u679c\u547d\u4ee4\u672a\u627e\u5230\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u73af\u5883\u53d8\u91cf\u672a\u6b63\u786e\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56  <\/p>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u5141\u8bb8\u60a8\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406Python\u5305\uff0c\u8fd9\u5bf9\u4e8e\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u9694\u79bb\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u547d\u4ee4<code>python -m venv venv_name<\/code>\uff0c\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>venv_name<\/code>\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong><br \/>\u521b\u5efa\u865a\u62df\u73af\u5883\u540e\uff0c\u60a8\u9700\u8981\u6fc0\u6d3b\u5b83\u3002\u5728Windows\u4e0a\uff0c\u8fd0\u884c<code>venv_name\\Scripts\\activate<\/code>\uff0c\u5728macOS\u548cLinux\u4e0a\uff0c\u8fd0\u884c<code>source venv_name\/bin\/activate<\/code>\u3002\u6fc0\u6d3b\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u5305\uff0c\u800c\u4e0d\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883\u5b89\u88c5\u5305<\/strong><br \/>\u5728\u6fc0\u6d3b\u7684\u865a\u62df\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u5305\u3002\u4f8b\u5982\uff0c\u8fd0\u884c<code>pip install flask<\/code>\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5Flask\u6846\u67b6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848  <\/p>\n<\/p>\n<p><p>\u5728Python\u73af\u5883\u4e0b\u6267\u884c\u5b89\u88c5\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4e86\u89e3\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u987a\u5229\u5730\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>pip\u547d\u4ee4\u4e0d\u53ef\u7528<\/strong><br \/>\u5982\u679c\u60a8\u5728\u547d\u4ee4\u884c\u4e2d\u53d1\u73b0pip\u547d\u4ee4\u4e0d\u53ef\u7528\uff0c\u9996\u5148\u68c0\u67e5Python\u662f\u5426\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86\u73af\u5883\u53d8\u91cf\u3002\u786e\u4fddPython\u5b89\u88c5\u76ee\u5f55\u548cScripts\u76ee\u5f55\u90fd\u88ab\u6dfb\u52a0\u5230PATH\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong><br \/>\u5728\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528pip\u5b89\u88c5\u5168\u5c40\u5305\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u6743\u9650\u95ee\u9898\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u524d\u6dfb\u52a0<code>sudo<\/code>\uff08Linux\u548cmacOS\uff09\u6216\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u6743\u9650\u95ee\u9898\uff0c\u56e0\u4e3a\u5b89\u88c5\u7684\u5305\u4ec5\u9650\u4e8e\u8be5\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5305\u5b89\u88c5\u5931\u8d25<\/strong><br \/>\u5982\u679c\u5728\u5b89\u88c5\u67d0\u4e2a\u5305\u65f6\u9047\u5230\u9519\u8bef\uff0c\u9996\u5148\u68c0\u67e5\u662f\u5426\u8f93\u5165\u4e86\u6b63\u786e\u7684\u5305\u540d\u3002\u60a8\u8fd8\u53ef\u4ee5\u5c1d\u8bd5\u5347\u7ea7pip\u5230\u6700\u65b0\u7248\u672c\uff0c\u6216\u8005\u67e5\u770b\u5305\u7684\u6587\u6863\u4ee5\u83b7\u53d6\u5b89\u88c5\u6307\u5357\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u603b\u7ed3  <\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u6b63\u786e\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u4f7f\u7528Python\u548c\u5176\u4e30\u5bcc\u7684\u751f\u6001\u7cfb\u7edf\u8fdb\u884c\u5f00\u53d1\u3002\u7406\u89e3\u5982\u4f55\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u4f7f\u7528pip\u7ba1\u7406\u5305\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u548c\u4f7f\u7528\u865a\u62df\u73af\u5883\u662fPython\u5f00\u53d1\u8005\u5fc5\u5907\u7684\u6280\u80fd\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0c\u638c\u63e1\u8fd9\u4e9b\u57fa\u7840\u77e5\u8bc6\u90fd\u5c06\u5e2e\u52a9\u60a8\u5728\u9879\u76ee\u4e2d\u66f4\u52a0\u81ea\u5982\u5730\u4f7f\u7528Python\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u3002\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\uff0c\u8f93\u5165\u547d\u4ee4 <code>pip install \u5305\u540d<\/code>\uff0c\u5176\u4e2d\u201c\u5305\u540d\u201d\u662f\u4f60\u60f3\u8981\u5b89\u88c5\u7684\u5e93\u7684\u540d\u79f0\u3002\u4f8b\u5982\uff0c\u82e5\u8981\u5b89\u88c5NumPy\u5e93\uff0c\u53ef\u4ee5\u8f93\u5165 <code>pip install numpy<\/code>\u3002\u786e\u4fdd\u4f60\u7684\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\uff0c\u5e76\u4e14pip\u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728Windows\u548cMac\u4e0a\u5b89\u88c5Python\u7684\u4e0d\u540c\u65b9\u6cd5\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7dWindows\u5b89\u88c5\u7a0b\u5e8f\uff0c\u8fd0\u884c\u540e\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\u3002\u5728Mac\u4e0a\uff0c\u6700\u7b80\u5355\u7684\u65b9\u5f0f\u662f\u4f7f\u7528Homebrew\uff0c\u8f93\u5165\u547d\u4ee4 <code>brew install python<\/code>\u5373\u53ef\u3002\u6b64\u5916\uff0c\u7528\u6237\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u8ba4Python\u53ca\u5176\u5e93\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165 <code>python --version<\/code> \u6765\u68c0\u67e5Python\u7684\u5b89\u88c5\u60c5\u51b5\uff0c\u786e\u8ba4\u7248\u672c\u53f7\u662f\u5426\u663e\u793a\u3002\u82e5\u8981\u68c0\u67e5\u67d0\u4e2a\u5e93\u662f\u5426\u5b89\u88c5\u6210\u529f\uff0c\u53ef\u4ee5\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\u8f93\u5165 <code>import \u5305\u540d<\/code>\uff0c\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u4f8b\u5982\uff0c\u8f93\u5165 <code>import numpy<\/code>\uff0c\u82e5\u65e0\u9519\u8bef\u5219\u8868\u793aNumPy\u5e93\u5df2\u6210\u529f\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f00\u5934\u6bb5\u843d\uff1a\u5728Python\u73af\u5883\u4e0b\u6267\u884c\u5b89\u88c5\u901a\u5e38\u6d89\u53ca\u5230\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u4ee5\u53ca\u914d\u7f6e\u73af\u5883 [&hellip;]","protected":false},"author":3,"featured_media":1016493,"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\/1016487"}],"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=1016487"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1016487\/revisions"}],"predecessor-version":[{"id":1016494,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1016487\/revisions\/1016494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1016493"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1016487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1016487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1016487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}