@echo off :: 临时换源:pip install requests -I https://pypi.tuna.tsinghua.edu.cn/simple :: 永久换源,本地创建pip.ini set pip_file=%USERPROFILE%\pip\pip.ini if not exist %pip_file% ( md %USERPROFILE%\pip echo [global] >> %pip_file% echo timeout=6000 >> %pip_file% echo index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> %pip_file% echo [install] >> %pip_file% echo trusted-host=mirrors.aliyun.com >> %pip_file% ) @echo on ::查看已安装的库; pip list pip uninstall numpy -y pip uninstall scipy -y pip uninstall xlrd -y pip uninstall matplotlib -y pip uninstall jsbeautifier -y :: 普通安装:pip install 模板名 :: 指定版本安装:pip install 模板名==版本 :: 卸载pip uninstall 模板名 pip3 install numpy==1.23.2 pip3 install scipy==1.9.1 pip3 install xlrd==1.2.0 pip3 install matplotlib==3.5.3 pip3 install jsbeautifier==1.14.6 :: 查看numpy的版本; pip show numpy :: 安装特定版本库: pip install package==version :: 更新指定模块: pip install --upgrade package :: 指定更新源更新版本: pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple package pause