{"id":54943,"date":"2024-10-09T23:03:21","date_gmt":"2024-10-09T15:03:21","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54943\/"},"modified":"2024-10-09T23:03:21","modified_gmt":"2024-10-09T15:03:21","slug":"%e5%9c%a8-linux%e3%80%81mac-%e5%92%8c-windows-%e7%b3%bb%e7%b5%b1%e4%b8%8a%e5%ae%89%e8%a3%9d-pip","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54943\/","title":{"rendered":"\u5728 Linux\u3001Mac \u548c Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd pip"},"content":{"rendered":"<h1 id=\"%e5%9c%a8-linux%e3%80%81mac-%e5%92%8c-windows-%e7%b3%bb%e7%b5%b1%e4%b8%8a%e5%ae%89%e8%a3%9d-pip-nIiuDuKTuz\">\u5728 Linux\u3001Mac \u548c Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd pip<\/h1>\n<p>\u5728 Python \u7684\u751f\u614b\u7cfb\u7d71\u4e2d\uff0cpip \u662f\u4e00\u500b\u975e\u5e38\u91cd\u8981\u7684\u5de5\u5177\uff0c\u5b83\u7528\u65bc\u5b89\u88dd\u548c\u7ba1\u7406 Python \u5305\u3002\u7121\u8ad6\u4f60\u662f\u958b\u767c\u8005\u9084\u662f\u6578\u64da\u79d1\u5b78\u5bb6\uff0c\u638c\u63e1 pip \u7684\u5b89\u88dd\u548c\u4f7f\u7528\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Linux\u3001Mac \u548c Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd pip\u3002<\/p>\n<h2 id=\"%e5%9c%a8-linux-%e7%b3%bb%e7%b5%b1%e4%b8%8a%e5%ae%89%e8%a3%9d-pip-nIiuDuKTuz\">\u5728 Linux \u7cfb\u7d71\u4e0a\u5b89\u88dd pip<\/h2>\n<p>\u5728\u5927\u591a\u6578 Linux \u767c\u884c\u7248\u4e2d\uff0cpip \u53ef\u4ee5\u901a\u904e\u5305\u7ba1\u7406\u5668\u8f15\u9b06\u5b89\u88dd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684 Linux \u767c\u884c\u7248\u7684\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"ubuntu-debian-nIiuDuKTuz\">Ubuntu\/Debian<\/h3>\n<pre><code>sudo apt update\nsudo apt install python3-pip<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5 pip \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre><code>pip3 --version<\/code><\/pre>\n<h3 id=\"centos-rhel-nIiuDuKTuz\">CentOS\/RHEL<\/h3>\n<pre><code>sudo yum install epel-release\nsudo yum install python3-pip<\/code><\/pre>\n<p>\u540c\u6a23\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u5b89\u88dd\uff1a<\/p>\n<pre><code>pip3 --version<\/code><\/pre>\n<h2 id=\"%e5%9c%a8-mac-%e7%b3%bb%e7%b5%b1%e4%b8%8a%e5%ae%89%e8%a3%9d-pip-nIiuDuKTuz\">\u5728 Mac \u7cfb\u7d71\u4e0a\u5b89\u88dd pip<\/h2>\n<p>\u5728 Mac \u7cfb\u7d71\u4e0a\uff0cpip \u901a\u5e38\u96a8\u8457 Python \u7684\u5b89\u88dd\u800c\u81ea\u52d5\u5b89\u88dd\u3002\u5982\u679c\u4f60\u4f7f\u7528 Homebrew \u5b89\u88dd Python\uff0cpip \u4e5f\u6703\u96a8\u4e4b\u5b89\u88dd\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8-homebrew-%e5%ae%89%e8%a3%9d-python-nIiuDuKTuz\">\u4f7f\u7528 Homebrew \u5b89\u88dd Python<\/h3>\n<pre><code>brew install python<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u6aa2\u67e5 pip \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre><code>pip3 --version<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u5df2\u7d93\u5b89\u88dd\u4e86 Python\uff0c\u4f46\u6c92\u6709 pip\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u624b\u52d5\u5b89\u88dd\uff1a<\/p>\n<pre><code>curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py\npython3 get-pip.py<\/code><\/pre>\n<h2 id=\"%e5%9c%a8-windows-%e7%b3%bb%e7%b5%b1%e4%b8%8a%e5%ae%89%e8%a3%9d-pip-nIiuDuKTuz\">\u5728 Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd pip<\/h2>\n<p>\u5728 Windows \u7cfb\u7d71\u4e0a\uff0cpip \u901a\u5e38\u96a8\u8457 Python \u7684\u5b89\u88dd\u800c\u81ea\u52d5\u5b89\u88dd\u3002\u5982\u679c\u4f60\u5c1a\u672a\u5b89\u88dd Python\uff0c\u53ef\u4ee5\u5f9e\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u5b89\u88dd\u5305\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d-python-nIiuDuKTuz\">\u5b89\u88dd Python<\/h3>\n<ul>\n<li>\u8a2a\u554f <a href=\"https:\/\/www.python.org\/downloads\/\" rel=\"nofollow noopener\" target=\"_blank\">Python \u5b98\u65b9\u7db2\u7ad9<\/a>\u3002<\/li>\n<li>\u4e0b\u8f09\u9069\u5408\u4f60\u7cfb\u7d71\u7684\u5b89\u88dd\u5305\u3002<\/li>\n<li>\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u78ba\u4fdd\u9078\u4e2d\u201cAdd Python to PATH\u201d\u9078\u9805\u3002<\/li>\n<\/ul>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u6253\u958b\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u6aa2\u67e5 pip \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre><code>pip --version<\/code><\/pre>\n<p>\u5982\u679c pip \u6c92\u6709\u5b89\u88dd\uff0c\u53ef\u4ee5\u624b\u52d5\u5b89\u88dd\uff1a<\/p>\n<pre><code>curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py\npython get-pip.py<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-nIiuDuKTuz\">\u7e3d\u7d50<\/h2>\n<p>\u7121\u8ad6\u4f60\u4f7f\u7528\u7684\u662f Linux\u3001Mac \u9084\u662f Windows \u7cfb\u7d71\uff0c\u5b89\u88dd pip \u7684\u904e\u7a0b\u90fd\u76f8\u5c0d\u7c21\u55ae\u3002\u638c\u63e1 pip \u7684\u4f7f\u7528\u5c07\u5927\u5927\u63d0\u9ad8\u4f60\u7684\u958b\u767c\u6548\u7387\uff0c\u8b93\u4f60\u80fd\u5920\u8f15\u9b06\u7ba1\u7406 Python \u5305\u3002\u5982\u679c\u4f60\u9700\u8981\u66f4\u9ad8\u6548\u7684\u958b\u767c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u90e8\u7f72\u4f60\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u4eab\u53d7\u66f4\u5feb\u7684\u97ff\u61c9\u901f\u5ea6\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Linux\u3001Mac \u548c Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd pip\uff0c\u8f15\u9b06\u7ba1\u7406 Python \u5957\u4ef6\uff0c\u63d0\u5347\u958b\u767c\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-54943","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=54943"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54943\/revisions"}],"predecessor-version":[{"id":54944,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54943\/revisions\/54944"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}