python pip 安裝

Windows

官網下載壓縮包並解壓。

官網:https://pypi.org/project/pip/#filespython

文件:選擇.tar.gz版本bootstrap

解壓後,進入解壓文件目錄,在當前路徑下打開cmd窗口windows

輸入:python setup.py installcurl

安裝完成。ide

windows環境下永久修改pip鏡像源的方法

(1)在windows文件管理器中,輸入 %APPDATA%url

(2)會定位到一個新的目錄下,在該目錄下新建pip文件夾,而後到pip文件夾裏面去新建個pip.ini文件code

(3)在新建的pip.ini文件中輸入如下內容ip

豆瓣源

[global]
timeout =6000
index-url = https://pypi.douban.com/simple
trusted-host = pypi.douban.comget

清華源

[global]
timeout =6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
trusted-host = pypi.tuna.tsinghua.edu.cncmd

阿里源

[global]
timeout =6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

將pip添加至path環境變量,在python安裝目錄的script

cmd窗口執行

pip3 list

Mac

Python2.7 中是自帶easy_install.py的而pip是須要手動安裝的sudo easy_install pip

Python3 中是使用curl https://bootstrap.pypa.io/get-pip.py | python3安裝pip3

檢驗是否安裝成功

pip3 --version

相關文章
相關標籤/搜索