pip常用配置及用法


Linux:

配置文件路徑:/etc/pip.conf  ~/.pip/pip.conf

 

Windows:

配置文件路徑:%appdata%\pip\pip.ini  %userprofile%\pip\pip.ini

 

常用配置:

[global]

index-url=http://mirrors.aliyun.com/pypi/simple

extra-index-url=https://pypi.tuna.tsinghua.edu.cn/simple

trusted-host=mirrors.aliyun.com

timeout=120

 

[install]

ignore-installed=true

no-dependencies=yes

 

常用用法:

 

  1. pip search -v
  2. pip installpip uninstall
    1. pip install --requirement | -r requirements             Install from the given requirements file
    2. pip install --upgrade | -U              Upgrade all specified packages
  3. pip list -v                    list installed packges  
  4. pip freeze -v  Ouput installed packges in requirements format
  5. pip show       Show information about installed packages
    pip show -f | --files   Show the full list of installed files
  6. pip completion --bash >> .bash_profile      Command completion
  7. for b in $(pip list --outdated | tail -n +3 | awk '{print $1}');do pip install --upgraed $b;done    升級所有--outdated包

whl安裝和使用:

wheel文件的本質就是zip或rar,其方便python的安裝和使用,pip install.

scikit_learn‑0.19.1‑cp27‑cp27m‑win32.whl

cp27  <==> cpython2.7

win32 <==> 32bits

cp37 <==> cpython3.7

win_amd64 <==> 64bits

whl下載站:https://www.lfd.uci.edu/~gohlke/pythonlibs/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM