{"id":937316,"date":"2024-12-26T19:49:42","date_gmt":"2024-12-26T11:49:42","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/937316.html"},"modified":"2024-12-26T19:49:44","modified_gmt":"2024-12-26T11:49:44","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85python-model","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/937316.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5python model"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25073229\/10be1e15-9f28-48dd-aef3-6479ad93f865.webp\" alt=\"\u5982\u4f55\u5b89\u88c5python model\" \/><\/p>\n<p><p> <strong>\u5b89\u88c5Python\u6a21\u5757\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\uff1a\u4f7f\u7528pip\u5de5\u5177\u3001\u4ece\u6e90\u7801\u5b89\u88c5\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u3002\u63a8\u8350\u4f7f\u7528pip\u5de5\u5177\u8fdb\u884c\u5b89\u88c5\uff0c\u56e0\u4e3a\u5b83\u662fPython\u7684\u5b98\u65b9\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u652f\u6301\u5b89\u88c5\u3001\u5347\u7ea7\u548c\u5378\u8f7dPython\u5305\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5Python\u6a21\u5757\u7684\u8be6\u7ec6\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u786e\u4fdd\u5df2\u5b89\u88c5pip<\/strong>\uff1a\u5728\u5927\u591a\u6570Python\u5b89\u88c5\u4e2d\uff0cpip\u4f1a\u81ea\u52a8\u5b89\u88c5\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7dget-pip.py\u811a\u672c\u5e76\u8fd0\u884c<code>python get-pip.py<\/code>\u6765\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u6a21\u5757<\/strong>\uff1a\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\uff0c\u8f93\u5165<code>pip install module_name<\/code>\uff0c\u5c06<code>module_name<\/code>\u66ff\u6362\u4e3a\u4f60\u8981\u5b89\u88c5\u7684\u6a21\u5757\u540d\u79f0\u3002\u4f8b\u5982\uff0c\u8981\u5b89\u88c5NumPy\u6a21\u5757\uff0c\u53ef\u4ee5\u8f93\u5165<code>pip install numpy<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<hr>\n<p><p>\u4e00\u3001\u4f7f\u7528PIP\u5de5\u5177<\/p>\n<\/p>\n<p><p><strong>PIP\u662fPython\u7684\u5305\u7ba1\u7406\u7cfb\u7edf\uff0c\u5141\u8bb8\u4f60\u4ecePython Package Index\uff08PyPI\uff09\u5b89\u88c5\u548c\u7ba1\u7406\u8f6f\u4ef6\u5305\u3002<\/strong><\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5pip\u662f\u5426\u5df2\u5b89\u88c5<\/strong>\uff1a\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86pip\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\uff1a<\/p>\n<\/p>\n<p><pre><code>pip --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679cpip\u5df2\u5b89\u88c5\uff0c\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>pip 21.0 from ...<\/code>\u7684\u8f93\u51fa\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u4f60\u9700\u8981\u5148\u5b89\u88c5pip\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python\u6a21\u5757<\/strong>\uff1a\u4e00\u65e6\u786e\u8ba4pip\u5df2\u5b89\u88c5\uff0c\u4f60\u5c31\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u5b89\u88c5Python\u6a21\u5757\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>pip install module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u8981\u5b89\u88c5\u8bf7\u6c42\u5e93\uff08requests\uff09\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<\/p>\n<p><pre><code>pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4ecePython Package Index\u4e0b\u8f7d\u5e76\u5b89\u88c5\u8bf7\u6c42\u5e93\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5347\u7ea7\u5df2\u5b89\u88c5\u7684\u6a21\u5757<\/strong>\uff1a\u5982\u679c\u4f60\u9700\u8981\u5347\u7ea7\u5df2\u5b89\u88c5\u7684\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>pip install --upgrade module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u786e\u4fdd\u4f60\u7684\u6a21\u5757\u662f\u6700\u65b0\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5378\u8f7d\u6a21\u5757<\/strong>\uff1a\u5982\u679c\u4f60\u9700\u8981\u5220\u9664\u67d0\u4e2a\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code>pip uninstall module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5220\u9664\u6307\u5b9a\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>PIP\u5de5\u5177\u7684\u4f18\u70b9\u5728\u4e8e\u5176\u7b80\u5355\u548c\u4fbf\u6377\u3002<\/strong>\u5b83\u81ea\u52a8\u5904\u7406\u6a21\u5757\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u786e\u4fdd\u6240\u6709\u5fc5\u8981\u7684\u7ec4\u4ef6\u90fd\u5f97\u5230\u5b89\u88c5\u3002\u6b64\u5916\uff0cpip\u8fd8\u652f\u6301\u4ece\u9700\u6c42\u6587\u4ef6\uff08requirements.txt\uff09\u6279\u91cf\u5b89\u88c5\u6a21\u5757\uff0c\u8fd9\u5bf9\u4e8e\u9879\u76ee\u5f00\u53d1\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4ece\u6e90\u7801\u5b89\u88c5<\/p>\n<\/p>\n<p><p><strong>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4ece\u6e90\u7801\u5b89\u88c5Python\u6a21\u5757\u3002<\/strong>\u8fd9\u901a\u5e38\u9002\u7528\u4e8e\u6ca1\u6709\u5728PyPI\u4e0a\u6258\u7ba1\u7684\u6a21\u5757\uff0c\u6216\u8005\u4f60\u60f3\u8981\u5bf9\u6a21\u5757\u8fdb\u884c\u81ea\u5b9a\u4e49\u4fee\u6539\u65f6\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u6e90\u7801<\/strong>\uff1a\u9996\u5148\uff0c\u4f60\u9700\u8981\u4ece\u9879\u76ee\u7684\u5b98\u65b9\u7f51\u7ad9\u6216\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\uff08\u5982GitHub\uff09\u4e0b\u8f7d\u6a21\u5757\u7684\u6e90\u7801\u3002\u901a\u5e38\uff0c\u8fd9\u4e9b\u6e90\u7801\u4f1a\u4ee5.zip\u6216.tar.gz\u683c\u5f0f\u63d0\u4f9b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u89e3\u538b\u7f29\u6587\u4ef6<\/strong>\uff1a\u4e0b\u8f7d\u540e\uff0c\u89e3\u538b\u7f29\u6587\u4ef6\u5230\u672c\u5730\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u6a21\u5757<\/strong>\uff1a\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u89e3\u538b\u7f29\u540e\u7684\u76ee\u5f55\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88c5\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code>python setup.py install<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u7f16\u8bd1\u5e76\u5b89\u88c5\u6a21\u5757\u5230\u4f60\u7684Python\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u4ece\u6e90\u7801\u5b89\u88c5\u7684\u4f18\u70b9\u662f\u7075\u6d3b\u6027\u3002<\/strong>\u4f60\u53ef\u4ee5\u5728\u5b89\u88c5\u524d\u67e5\u770b\u6e90\u7801\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u4fee\u6539\u3002\u6b64\u5916\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4e5f\u9002\u7528\u4e8e\u9700\u8981\u7f16\u8bd1\u7684\u6a21\u5757\uff0c\u4f8b\u5982\u90a3\u4e9b\u5305\u542bC\u6269\u5c55\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5668<\/p>\n<\/p>\n<p><p><strong>\u5728Linux\u548cmacOS\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5Python\u6a21\u5757\u3002<\/strong>\u8fd9\u901a\u5e38\u7528\u4e8e\u5b89\u88c5\u4e00\u4e9b\u9700\u8981\u7cfb\u7edf\u7ea7\u6743\u9650\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>APT\uff08\u9002\u7528\u4e8eDebian\u548cUbuntu\uff09<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install python3-module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u8981\u5b89\u88c5Python 3\u7248\u672c\u7684requests\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install python3-requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>YUM\uff08\u9002\u7528\u4e8eCentOS\u548cFedora\uff09<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code>sudo yum install python3-module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4f7f\u7528\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u6a21\u5757\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Homebrew\uff08\u9002\u7528\u4e8emacOS\uff09<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code>brew install module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Homebrew\u662fmacOS\u7684\u7b2c\u4e09\u65b9\u5305\u7ba1\u7406\u5668\uff0c\u9002\u7528\u4e8e\u5b89\u88c5\u5404\u79cd\u547d\u4ee4\u884c\u5de5\u5177\u548c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u7684\u4f18\u70b9\u5728\u4e8e\u5176\u96c6\u6210\u6027\u3002<\/strong>\u5b83\u4eec\u901a\u5e38\u4f1a\u5904\u7406\u4e0e\u7cfb\u7edf\u5e93\u548c\u5176\u4ed6\u8f6f\u4ef6\u5305\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002\u7136\u800c\uff0c\u5305\u7ba1\u7406\u5668\u63d0\u4f9b\u7684\u6a21\u5757\u7248\u672c\u53ef\u80fd\u8f83\u65e7\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u5feb\u901f\u53d1\u5c55\u7684\u9879\u76ee\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883<\/p>\n<\/p>\n<p><p><strong>\u865a\u62df\u73af\u5883\u662fPython\u7684\u4e00\u4e2a\u5f3a\u5927\u529f\u80fd\uff0c\u5141\u8bb8\u4f60\u5728\u72ec\u7acb\u7684\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u6a21\u5757\u3002<\/strong>\u8fd9\u975e\u5e38\u6709\u52a9\u4e8e\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86<code>virtualenv<\/code>\u6216<code>venv<\/code>\u6a21\u5757\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code>python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>myenv<\/code>\u7684\u65b0\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u542b\u72ec\u7acb\u7684Python\u53ef\u6267\u884c\u6587\u4ef6\u548cpip\u5de5\u5177\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong>\uff1a\u8981\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u9996\u5148\u9700\u8981\u6fc0\u6d3b\u5b83\u3002\u5728Windows\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code>myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code>source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u6a21\u5757<\/strong>\uff1a\u4e00\u65e6\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff0c\u4f60\u53ef\u4ee5\u50cf\u5e73\u5e38\u4e00\u6837\u4f7f\u7528pip\u5b89\u88c5\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code>pip install module_name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e9b\u6a21\u5757\u5c06\u4ec5\u5728\u5f53\u524d\u865a\u62df\u73af\u5883\u4e2d\u53ef\u7528\uff0c\u800c\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u8303\u56f4\u7684Python\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9000\u51fa\u865a\u62df\u73af\u5883<\/strong>\uff1a\u5b8c\u6210\u5de5\u4f5c\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code>deactivate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883\u7684\u6700\u5927\u4f18\u70b9\u662f\u9694\u79bb\u6027\u3002<\/strong>\u8fd9\u4f7f\u5f97\u4f60\u53ef\u4ee5\u4e3a\u4e0d\u540c\u7684\u9879\u76ee\u4f7f\u7528\u4e0d\u540c\u7248\u672c\u7684\u6a21\u5757\u800c\u4e0d\u53d1\u751f\u51b2\u7a81\u3002\u6b64\u5916\uff0c\u865a\u62df\u73af\u5883\u8fd8\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u4e0d\u540cPython\u7248\u672c\u4e4b\u95f4\u5207\u6362\u7684\u4fbf\u6377\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Python\u6a21\u5757\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u81f3\u5173\u91cd\u8981\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u7528\u6237\u6765\u8bf4\uff0c\u4f7f\u7528pip\u662f\u6700\u7b80\u5355\u548c\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4ece\u6e90\u7801\u5b89\u88c5\u6216\u4f7f\u7528\u7cfb\u7edf\u5305\u7ba1\u7406\u5668\u3002<\/p>\n<\/p>\n<p><p><strong>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5b89\u88c5Python\u6a21\u5757\u7684\u6700\u4f73\u5b9e\u8df5\uff1a<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883<\/strong>\uff1a\u59cb\u7ec8\u5728\u865a\u62df\u73af\u5883\u4e2d\u5de5\u4f5c\uff0c\u4ee5\u907f\u514d\u4f9d\u8d56\u51b2\u7a81\uff0c\u5e76\u4fdd\u6301\u7cfb\u7edf\u73af\u5883\u7684\u6e05\u6d01\u3002<\/li>\n<li><strong>\u5b9a\u671f\u66f4\u65b0\u6a21\u5757<\/strong>\uff1a\u4f7f\u7528pip\u7684\u5347\u7ea7\u529f\u80fd\u4fdd\u6301\u6a21\u5757\u66f4\u65b0\uff0c\u4ee5\u83b7\u5f97\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u8865\u4e01\u3002<\/li>\n<li><strong>\u8bb0\u5f55\u4f9d\u8d56\u5173\u7cfb<\/strong>\uff1a\u4f7f\u7528<code>pip freeze &gt; requirements.txt<\/code>\u547d\u4ee4\u751f\u6210\u9879\u76ee\u7684\u4f9d\u8d56\u5173\u7cfb\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5728\u9700\u8981\u65f6\u53ef\u4ee5\u5feb\u901f\u91cd\u5efa\u73af\u5883\u3002<\/li>\n<li><strong>\u9075\u5faa\u5b98\u65b9\u6587\u6863<\/strong>\uff1a\u5728\u5b89\u88c5\u590d\u6742\u6a21\u5757\u65f6\uff0c\u52a1\u5fc5\u67e5\u9605\u5b98\u65b9\u6587\u6863\u4ee5\u83b7\u53d6\u7279\u5b9a\u7684\u5b89\u88c5\u8bf4\u660e\u548c\u4f9d\u8d56\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u9075\u5faa\u8fd9\u4e9b\u5b9e\u8df5\uff0c\u4f60\u53ef\u4ee5\u786e\u4fddPython\u9879\u76ee\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u6a21\u578b\u8fdb\u884c\u5b89\u88c5\uff1f<\/strong><br \/>\u5728\u9009\u62e9Python\u6a21\u578b\u65f6\uff0c\u8003\u8651\u9879\u76ee\u7684\u9700\u6c42\u81f3\u5173\u91cd\u8981\u3002\u9996\u5148\uff0c\u5206\u6790\u4f60\u7684\u9879\u76ee\u76ee\u6807\uff0c\u4f8b\u5982\u6570\u636e\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u6216\u6df1\u5ea6\u5b66\u4e60\u3002\u63a5\u7740\uff0c\u67e5\u770b\u6a21\u578b\u7684\u6587\u6863\u548c\u793e\u533a\u652f\u6301\uff0c\u786e\u4fdd\u5b83\u7b26\u5408\u4f60\u7684\u6280\u672f\u6808\u548c\u4f7f\u7528\u573a\u666f\u3002\u6b64\u5916\uff0c\u8003\u8651\u6a21\u578b\u7684\u6027\u80fd\u548c\u517c\u5bb9\u6027\uff0c\u786e\u4fdd\u5b83\u80fd\u591f\u5728\u4f60\u7684\u5f00\u53d1\u73af\u5883\u4e2d\u987a\u5229\u8fd0\u884c\u3002<\/p>\n<p><strong>\u5b89\u88c5Python\u6a21\u578b\u65f6\u5e38\u89c1\u7684\u9519\u8bef\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u7528\u6237\u5728\u5b89\u88c5Python\u6a21\u578b\u65f6\uff0c\u5e38\u5e38\u4f1a\u9047\u5230\u7248\u672c\u4e0d\u517c\u5bb9\u7684\u95ee\u9898\u3002\u786e\u4fdd\u4f60\u7684Python\u7248\u672c\u4e0e\u6240\u9009\u6a21\u578b\u8981\u6c42\u76f8\u7b26\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u6b64\u5916\uff0c\u5e93\u4f9d\u8d56\u672a\u5b89\u88c5\u6216\u7248\u672c\u51b2\u7a81\u4e5f\u4f1a\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25\u3002\u56e0\u6b64\uff0c\u4f7f\u7528\u865a\u62df\u73af\u5883\uff08\u5982venv\u6216conda\uff09\u53ef\u4ee5\u6709\u6548\u907f\u514d\u8fd9\u4e9b\u95ee\u9898\uff0c\u786e\u4fdd\u9879\u76ee\u4f9d\u8d56\u7684\u9694\u79bb\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u5b89\u88c5Python\u6a21\u578b\u540e\u8fdb\u884c\u9a8c\u8bc1\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9a8c\u8bc1\u6a21\u578b\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u6a21\u578b\u81ea\u5e26\u7684\u6d4b\u8bd5\u7528\u4f8b\u6216\u793a\u4f8b\u4ee3\u7801\u6765\u5b9e\u73b0\u3002\u5927\u591a\u6570\u6a21\u578b\u90fd\u63d0\u4f9b\u4e86\u6587\u6863\u4e2d\u7684\u793a\u4f8b\uff0c\u786e\u4fdd\u4f60\u80fd\u591f\u6210\u529f\u5bfc\u5165\u5e76\u8c03\u7528\u6a21\u578b\u7684\u4e3b\u8981\u529f\u80fd\u3002\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u7b80\u5355\u7684\u6570\u636e\u8f93\u5165\u6765\u68c0\u67e5\u6a21\u578b\u7684\u8f93\u51fa\uff0c\u786e\u4fdd\u5b83\u7b26\u5408\u9884\u671f\u7684\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u88c5Python\u6a21\u5757\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\uff1a\u4f7f\u7528pip\u5de5\u5177\u3001\u4ece\u6e90\u7801\u5b89\u88c5\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u3002\u63a8\u8350\u4f7f\u7528pip\u5de5\u5177\u8fdb [&hellip;]","protected":false},"author":3,"featured_media":937319,"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\/937316"}],"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=937316"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/937316\/revisions"}],"predecessor-version":[{"id":937321,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/937316\/revisions\/937321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/937319"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=937316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=937316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=937316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}