python + pip 独家秘籍
1. 起因, 目的:
- 我用 python 这么多年了,还是会遇到 pip 报错,是时候放出我的独家秘籍了。
- 总共就这几种情况, 就这几种对策。
2. 过程:
pip 镜像
文件位置: C:\Users\Administrator\pip
[global]
index-url = https://mirrors.163.com/pypi/simple/ # 163 有时候速度差
https://mirrors.bfsu.edu.cn/pypi/web/simple # 北京外国语大学,速度极快。
临时使用本地代理
pip install requests --proxy https://127.0.0.1:13859
pip install git+https://github.com/kernc/backtesting.py.git --proxy https://127.0.0.1:13859
临时用一下镜像
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple protobuf==3.6.0
pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple some-package
根据 setup.py 来安装
pip install -e .
或
python -m pip install -e detectron2
detectron2 是项目文件夹,里面包含一个 setup.py
- pip 重新安装一个包
pip install --force-reinstall pandas
pip 查找全部的配置文件
pip config -v list
希望对大家有帮助。