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