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
常用用法:
- pip search -v
- pip installpip uninstall
- pip install --requirement | -r requirements Install from the given requirements file
- pip install --upgrade | -U Upgrade all specified packages
- pip list -v list installed packges
- pip freeze -v Ouput installed packges in requirements format
- pip show Show information about installed packages
pip show -f | --files Show the full list of installed files - pip completion --bash >> .bash_profile Command completion
- 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/