
使用
#清华源安装
#临时使用
pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple some-package
#升级 pip 到最新的版本后进行配置
python -m pip install --upgrade pip
python -m pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --upgrade pip
#更新源
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
pip安装包的默认缓存位置
在Windows上,pip的默认缓存位置通常位于用户的主目录下的AppData文件夹中,具体路径可能是C:\Users\<用户名>\AppData\Local\pip\Cache
在macOS和Linux上,pip的默认缓存位置通常位于用户的主目录下的.cache文件夹中,具体路径可能是/home/<用户名>/.cache/pip/Cache
pip cache list
export PIP_CACHE_DIR=/path/to/your/cache/directory
source ~/.bashrc