{"id":255,"date":"2024-11-14T11:18:51","date_gmt":"2024-11-14T03:18:51","guid":{"rendered":"https:\/\/telaker.cn\/?p=255"},"modified":"2024-11-17T10:40:40","modified_gmt":"2024-11-17T02:40:40","slug":"pip02","status":"publish","type":"post","link":"https:\/\/telaker.cn\/index.php\/2024\/11\/14\/pip02\/","title":{"rendered":"\u4f18\u5316pip\u901f\u5ea6\uff0c\u591a\u7ebf\u7a0b\u3001\u9884\u7f16\u8bd1\u3001\u6784\u5efa\u5de5\u5177"},"content":{"rendered":"\n<p>\u5728\u4f7f\u7528pip\u5b89\u88c5Python\u5305\u65f6\uff0c\u6709\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u9700\u8981\u52a0\u901f\u4e0b\u8f7d\u6216\u7f16\u8bd1\u8fc7\u7a0b\u7684\u60c5\u51b5\u3002\u867d\u7136pip\u672c\u8eab\u5e76\u4e0d\u76f4\u63a5\u652f\u6301\u8bbe\u7f6e\u4f7f\u7528\u5168\u90e8CPU\u6838\u5fc3\u8fdb\u884c\u5e76\u884c\u64cd\u4f5c\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u65b9\u6cd5\u6765\u4f18\u5316\u6027\u80fd\uff0c\u4f8b\u5982\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u6216\u8005\u7279\u5b9a\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u7684\u7b56\u7565\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4f7f\u7528<code>--processes<\/code>\u53c2\u6570<\/strong>\uff1a\u4ecepip 21.3\u7248\u672c\u5f00\u59cb\uff0c\u5f15\u5165\u4e86\u4e00\u4e2a\u65b0\u7684\u529f\u80fd\uff0c\u5141\u8bb8\u7528\u6237\u6307\u5b9a\u7528\u4e8e\u5e76\u884c\u4e0b\u8f7d\u7684\u6700\u5927\u8fdb\u7a0b\u6570\u3002\u8fd9\u4e2a\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u52a0\u5feb\u591a\u4e2a\u5305\u7684\u4e0b\u8f7d\u901f\u5ea6\uff0c\u5c24\u5176\u662f\u5728\u7f51\u7edc\u6761\u4ef6\u826f\u597d\u7684\u60c5\u51b5\u4e0b\u3002<br><code>pip install package_name --processes 4<\/code> <br>\u8fd9\u91cc\u7684<code>4<\/code>\u53ef\u4ee5\u6839\u636e\u4f60\u673a\u5668\u7684<strong>CPU\u6838\u5fc3\u6570<\/strong>\u8fdb\u884c\u8c03\u6574\uff0c\u4ee5\u5145\u5206\u5229\u7528\u591a\u6838\u5904\u7406\u5668\u7684\u4f18\u52bf\u3002<\/li>\n\n\n\n<li><strong>\u5229\u7528\u865a\u62df\u73af\u5883<\/strong>\uff1a\u867d\u7136\u8fd9\u4e0d\u76f4\u63a5\u589e\u52a0CPU\u7684\u4f7f\u7528\u7387\uff0c\u4f46\u521b\u5efa\u548c\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u5168\u5c40\u73af\u5883\u4e2d\u7684\u4f9d\u8d56\u51b2\u7a81\uff0c\u4ece\u800c\u95f4\u63a5\u63d0\u9ad8\u5b89\u88c5\u548c\u8fd0\u884c\u6548\u7387\u3002 <code><br>python -m venv myenv source myenv\/bin\/activate pip install package_name<\/code><\/li>\n\n\n\n<li><strong>\u5347\u7ea7pip<\/strong>\uff1a\u786e\u4fdd\u4f60\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c\u7684pip\uff0c\u56e0\u4e3a\u65b0\u7248\u672c\u901a\u5e38\u4f1a\u5305\u542b\u6027\u80fd\u6539\u8fdb\u548c\u9519\u8bef\u4fee\u590d\u3002 <code><br>pip install --upgrade pip<\/code><\/li>\n\n\n\n<li><strong>\u4f7f\u7528\u66f4\u5feb\u7684\u7f51\u7edc\u6e90<\/strong>\uff1a\u9009\u62e9\u4e00\u4e2a\u79bb\u4f60\u5730\u7406\u4f4d\u7f6e\u66f4\u8fd1\u6216\u8005\u54cd\u5e94\u901f\u5ea6\u66f4\u5feb\u7684PyPI\u955c\u50cf\u6e90\uff0c\u53ef\u4ee5\u51cf\u5c11\u4e0b\u8f7d\u65f6\u95f4\u3002 <code><br>pip install package_name -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/code><\/li>\n\n\n\n<li><strong>\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u5305<\/strong>\uff1a\u5bf9\u4e8e\u67d0\u4e9b\u5305\uff0c\u53ef\u4ee5\u9009\u62e9\u9884\u7f16\u8bd1\u597d\u7684\u4e8c\u8fdb\u5236\u7248\u672c\u800c\u4e0d\u662f\u6e90\u4ee3\u7801\u7f16\u8bd1\uff0c\u8fd9\u6837\u53ef\u4ee5\u8282\u7701\u5927\u91cf\u7684\u7f16\u8bd1\u65f6\u95f4\u3002 <code><br>pip install package_name --only-binary :all:<\/code><\/li>\n\n\n\n<li><strong>\u4f7f\u7528\u6784\u5efa\u5de5\u5177<\/strong>\uff1a\u5bf9\u4e8e\u9700\u8981\u7f16\u8bd1\u7684C\u6269\u5c55\u6a21\u5757\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982<code>setuptools<\/code>\u3001<code>wheel<\/code>\u7b49\u5de5\u5177\u6765\u4f18\u5316\u7f16\u8bd1\u8fc7\u7a0b\u3002 <code><br>pip install setuptools wheel<\/code><\/li>\n<\/ol>\n\n\n\n<p>\u603b\u7684\u6765\u8bf4\uff0c\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4f18\u5316pip\u7684\u5b89\u88c5\u8fc7\u7a0b\uff0c\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u5e76\u4e0d\u80fd\u76f4\u63a5\u63a7\u5236CPU\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u800c\u662f\u901a\u8fc7\u5e76\u884c\u5904\u7406\u548c\u4f18\u5316\u914d\u7f6e\u6765\u63d0\u5347\u6574\u4f53\u6548\u7387\u3002\u5982\u679c\u786e\u5b9e\u9700\u8981\u7cbe\u7ec6\u63a7\u5236CPU\u7684\u4f7f\u7528\uff0c\u53ef\u80fd\u9700\u8981\u7ed3\u5408\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u522b\u7684\u8d44\u6e90\u7ba1\u7406\u5de5\u5177\u6765\u5b9e\u73b0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528pip\u5b89\u88c5Python\u5305\u65f6\uff0c\u6709\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u9700\u8981\u52a0\u901f\u4e0b\u8f7d\u6216\u7f16\u8bd1\u8fc7\u7a0b\u7684\u60c5\u51b5\u3002\u867d\u7136pip\u672c\u8eab\u5e76\u4e0d\u76f4\u63a5\u652f\u6301\u8bbe\u7f6e\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[28,29],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-pip","tag-pip","tag-python"],"_links":{"self":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":0,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"wp:attachment":[{"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/telaker.cn\/index.php\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}