1. 程式人生 > >python中pip 升級 安裝解除安裝操作

python中pip 升級 安裝解除安裝操作

C:\Windows\System32>pip --version
pip 18.1 from c:\dev\python36\lib\site-packages\pip (python 3.6)

C:\Windows\System32>python --version
Python 3.6.6

pip軟體的升級:
python -m pip install --upgrade pip

--pip命令:
C:\Windows\System32>pip  --help

Usage:
  pip <command> [options]


Commands:
 install                    安裝包.
 uninstall                  解除安裝包.
 freeze                     按著一定格式輸出已安裝包列表
 list                       列出已安裝包.
 show                       顯示包詳細資訊.
 search                     搜尋包,類似yum裡的search.
 wheel                      Buildwheelsfromyourrequirements.
 zip                        不推薦.Zipindividualpackages.
 unzip                      不推薦.Unzipindividualpackages.
 bundle                     不推薦.Createpybundles.
 help                       當前幫助.
 
GeneralOptions:
 -h,--help                 顯示幫助.
 -v,--verbose              更多的輸出,最多可以使用3次
 -V,--version              現實版本資訊然後退出.
 -q,--quiet                最少的輸出.
 --log-file<path>          覆蓋的方式記錄verbose錯誤日誌,預設檔案:/root/.pip/pip.log
 --log<path>               不覆蓋記錄verbose輸出的日誌.
 --proxy<proxy>            Specifyaproxyintheform[user:
[email protected]
]proxy.server:port. --timeout<sec> 連線超時時間(預設15秒). --exists-action<action> Defaultactionwhenapathalreadyexists:(s)witch,(i)gnore,(w)ipe,(b)ackup. --cert<path> 證書. --軟體安裝位置查詢: C:\Windows\System32>pip show --files redis Name: redis Version: 2.10.6 -- 查詢過期的軟體: C:\Windows\System32>pip list --outdated Package Version Latest Type ---------------------- ----------- ---------- ----- alembic 0.8.10 1.0.5 sdist beautifulsoup4 4.6.0 4.7.1 wheel certifi 2017.7.27.1 2018.11.29 wheel click 6.7 7.0 wheel PyMySQL 0.7.11 0.9.3 wheel -- 軟體升級: C:\Windows\System32>pip install --upgrade PyMySQL==0.9.3 Collecting PyMySQL==0.9.3 Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2.py3-none-any.whl (47kB) 100% |████████████████████████████████| 51kB 216kB/s Installing collected packages: PyMySQL Found existing installation: PyMySQL 0.7.11 Uninstalling PyMySQL-0.7.11: Successfully uninstalled PyMySQL-0.7.11 Successfully installed PyMySQL-0.9.3 --軟體的解除安裝: C:\Windows\System32>pip install redis Requirement already satisfied: redis in c:\dev\python36\lib\site-packages (2.10.6) C:\Windows\System32>pip uninstall redis Uninstalling redis-2.10.6: Would remove: c:\dev\python36\lib\site-packages\redis-2.10.6.dist-info\* c:\dev\python36\lib\site-packages\redis\* Proceed (y/n)? y Successfully uninstalled redis-2.10.6