This shows you the differences between two versions of the page.
— |
library:python:command [2022/05/02 00:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Python 常用命令 ====== | ||
+ | ---- | ||
+ | |||
+ | ===== 更换国内pypi镜像 ===== | ||
+ | |||
+ | 国内pypi镜像 | ||
+ | 阿里:https:// | ||
+ | 豆瓣:http:// | ||
+ | 中国科学技术大学:http:// | ||
+ | 指定单次安装源 | ||
+ | pip install < | ||
+ | |||
+ | 指定全局安装源 | ||
+ | 在unix和macos,配置文件为:$HOME/ | ||
+ | 在windows上,配置文件为:%HOME%\pip\pip.ini | ||
+ | |||
+ | [global] | ||
+ | timeout = 6000 | ||
+ | index-url = http:// | ||
+ | |||
+ | 卸载包 | ||
+ | pip uninstall < | ||
+ | |||
+ | ===== 升级包 ===== | ||
+ | |||
+ | pip install -U < | ||
+ | |||
+ | 或:pip install < | ||
+ | | ||
+ | ===== 升级pip ===== | ||
+ | |||
+ | pip install -U pip | ||
+ | |||
+ | pip install -U pip -i https:// | ||
+ | |||
+ | ===== 重装pip ===== | ||
+ | python -m pip install --upgrade --force-reinstall pip -i https:// | ||
+ | |||
+ | ===== 安装包 ===== | ||
+ | pip install zeroconf -i https:// | ||
+ | |||
+ | |||
+ | ===== Reinstall pip ===== | ||
+ | |||
+ | python -m ensurepip | ||
+ | python -m pip install --upgrade pip |