pip

Ling Yu
pip使用
install pip
python -m ensurepip --default-pip
upgrade pip
python -m pip install --upgrade pip
pip list --outdated --format=columns //查看可更新包
pip install pip-review //批量下载并更新
pip-review --local --interactive
配置多个源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple //设置源
配置多个源
pip config set global.extra-index-url "<url1> <url2>..."
pip_search
linux
alias pip='function _pip(){
if [ $1 = "search" ]; then
pip_search "$2";
else pip "$@";
fi;
};_pip'
win
function pp {
if ($args[0] -eq "search") {
pip_search $args[1..$args.Length]
}
else {
pip $args[0..$args.Length]
}
}
导出第三方包
pip freeze >requirements.txt
卸载第三方库
pip uninstall -r requirements.txt -y
安装第三方库
pip install -r requirements.txt -y