創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)BGP香港云服務(wù)器提供商,新人活動買多久送多久,劃算不套路!
成都網(wǎng)站建設(shè)、成都網(wǎng)站制作的關(guān)注點(diǎn)不是能為您做些什么網(wǎng)站,而是怎么做網(wǎng)站,有沒有做好網(wǎng)站,給創(chuàng)新互聯(lián)一個展示的機(jī)會來證明自己,這并不會花費(fèi)您太多時間,或許會給您帶來新的靈感和驚喜。面向用戶友好,注重用戶體驗(yàn),一切以用戶為中心。這篇文章將為大家詳細(xì)講解有關(guān)python中安裝pip工具的方法,小編覺得挺實(shí)用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
下載pip
地址:https://pypi.python.org/pypi/pip#downloads
注意選擇tar.gz壓縮包,目前最新版本為19.1.1,這里選擇的版本是:pip-19.1.1.tar.gz (md5, pgp)
點(diǎn)擊:下載
2. 解壓安裝
解壓下載的壓縮包至工作目錄下(如D:\),打開Windows cmd,運(yùn)行如下命令進(jìn)入解壓后的pip目錄
cd /d D:\pip-19.1.1
使用如下命令進(jìn)行安裝
python setup.py install
3. 添加環(huán)境變量
添加windows系統(tǒng)環(huán)境變量,與安裝python時添加的方法一樣
如我的python目錄是:F:\Python27\;
則添加如下2個目錄到系統(tǒng)環(huán)境變量里:F:\Python27\;F:\Python27\Scripts;
4. pip常用命令
安裝成功后,重新進(jìn)入CMD后運(yùn)行pip,可以看到幫助文檔:
Usage: pip[options] Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. config Manage local and global configuration. search Search PyPI for packages. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. help Show help for commands. General Options: -h, --help Show help. --isolated Run pip in an isolated mode, ignoring environment variables and user configuration. -v, --verbose Give more output. Option is additive, and can be used up to 3 times. -V, --version Show version and exit. -q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels). --log Path to a verbose appending log. --proxy Specify a proxy in the form [user:passwd@]proxy.server:port. --retries Maximum number of retries each connection should attempt (default 5 times). --timeout Set the socket timeout (default 15 seconds). --exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort. --trusted-host Mark this host as trusted, even though it does not have valid or any HTTPS. --cert Path to alternate CA bundle. --client-cert Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. --cache-dir Store the cache data in . --no-cache-dir Disable the cache. --disable-pip-version-check Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index. --no-color Suppress colored output
pip常用命令如下:
#安裝包 pip install xxx #升級包,可以使用-U 或者 --upgrade pip install -U xxx #卸載包 pip uninstall xxx #列出已安裝的包 pip list
關(guān)于python中安裝pip工具的方法就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。