﻿{"id":13286,"date":"2022-03-10T08:39:20","date_gmt":"2022-03-10T00:39:20","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=13286"},"modified":"2022-03-10T08:39:20","modified_gmt":"2022-03-10T00:39:20","slug":"python-pip-pip3","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/python-pip-pip3.html","title":{"rendered":"\u89e3\u51b3Python\u4e2dpip\/pip3\u4e0b\u8f7d\u901f\u5ea6\u6162"},"content":{"rendered":"<h1 id=\"pypi-\u955c\u50cf\">PyPI \u955c\u50cf<\/h1>\n<h2 id=\"\u7b80\u4ecb\">\u7b80\u4ecb<\/h2>\n<p>PyPI (Python Package Index) \u662f Python \u7f16\u7a0b\u8bed\u8a00\u7684\u8f6f\u4ef6\u5b58\u50a8\u5e93\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7 PyPI \u67e5\u627e\u548c\u5b89\u88c5\u7531 Python \u793e\u533a\u5f00\u53d1\u548c\u5171\u4eab\u7684\u8f6f\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u5c06\u81ea\u5df1\u5f00\u53d1\u7684\u5e93\u4e0a\u4f20\u81f3 PyPI \u3002<\/p>\n<h2 id=\"linux\u4e0b\u66f4\u6362pip\u6e90\">Linux\u4e0b\u66f4\u6362pip\u6e90<\/h2>\n<p>\u4f7f\u7528pip\/pip3\u5b89\u88c5\u4e00\u4e9bpython\u5305\u7684\u65f6\u5019\u4e0b\u8f7d\u901f\u5ea6\u975e\u5e38\u6162\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u52a8\u624b\u66f4\u6362python\u7684pip\/pip3\u6e90\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u627e\u5230<code>~\/.pip\/pip.conf<\/code>\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u6587\u4ef6\u81ea\u5df1\u521b\u5efa\u4e00\u4e2a\u540c\u540d\u6587\u4ef6\uff0c\u6216\u8005\u4f60\u7684\u7cfb\u7edf\u8fde<code>~.\/pip<\/code>\u8fd9\u4e2a\u76ee\u5f55\u4e5f\u6ca1\u6709\uff0c\u90a3\u5c31\u81ea\u5df1\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u5e76\u4e14\u5728\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a<code>pip.conf<\/code>\u6587\u4ef6\uff0c\u5e76\u5411\u8be5\u6587\u4ef6\u6dfb\u52a0\u6216\u4fee\u6539\u6210\u4ee5\u4e0b\u5185\u5bb9\u3002<\/p>\n<pre><code class=\"hljs language-ini hljsln\"><span class=\"hljs-section\">[global]<\/span>\r\n<span class=\"hljs-attr\">index-url<\/span> = https:\/\/mirrors.aliyun.com\/pypi\/simple\/\r\n\r\n<span class=\"hljs-section\">[install]<\/span>\r\n<span class=\"hljs-attr\">trusted-host<\/span>=mirrors.aliyun.com\r\n<\/code><\/pre>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13288\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2022\/02\/python-pip-pip3-1.png\" alt=\"\" width=\"1718\" height=\"636\" \/><\/h2>\n<h2 id=\"windows\u4e0b\u66f4\u6362pip\u6e90\">windows\u4e0b\u66f4\u6362pip\u6e90<\/h2>\n<ol>\n<li>\u6587\u4ef6\u7ba1\u7406\u5668\u7684\u5730\u5740\u680f\u8f93\u5165<code>%appdata%<\/code>\u56de\u8f66\u8fdb\u5165\u5f53\u524d\u7528\u6237\u4e3b\u76ee\u5f55<\/li>\n<li>\u5728\u5f53\u524d\u6587\u4ef6\u5939\u4e0b\u65b0\u5efa\u6587\u4ef6\u5939<code>pip<\/code><\/li>\n<li>\u5728pip\u6587\u4ef6\u5939\u4e0b\u65b0\u5efa\u6587\u4ef6<code>pip.ini<\/code>\u6587\u4ef6<\/li>\n<li>\u5728<code>pip.ini<\/code>\u6587\u4ef6\u4e2d\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9<\/li>\n<\/ol>\n<pre><code class=\"hljs language-ini hljsln\"><span class=\"hljs-section\">[global]<\/span>\r\n<span class=\"hljs-attr\">index-url<\/span> = https:\/\/mirrors.aliyun.com\/pypi\/simple\/\r\n\r\n<span class=\"hljs-section\">[install]<\/span>\r\n<span class=\"hljs-attr\">trusted-host<\/span>=mirrors.aliyun.com<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13289\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2022\/02\/python-pip-pip3.png\" alt=\"\" width=\"2212\" height=\"1318\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PyPI \u955c\u50cf \u7b80\u4ecb PyPI (Python Package Index) \u662f Python \u7f16\u7a0b &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[988,987,44],"class_list":["post-13286","post","type-post","status-publish","format-standard","hentry","category-python","tag-pip","tag-pip3","tag-python"],"aioseo_notices":[],"views":705,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/13286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=13286"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/13286\/revisions"}],"predecessor-version":[{"id":13815,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/13286\/revisions\/13815"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=13286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=13286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=13286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}