pip_install.bat 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. @echo off
  2. :: 临时换源:pip install requests -I https://pypi.tuna.tsinghua.edu.cn/simple
  3. :: 永久换源,本地创建pip.ini
  4. set pip_file=%USERPROFILE%\pip\pip.ini
  5. if not exist %pip_file% (
  6. md %USERPROFILE%\pip
  7. echo [global] >> %pip_file%
  8. echo timeout=6000 >> %pip_file%
  9. echo index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> %pip_file%
  10. echo [install] >> %pip_file%
  11. echo trusted-host=mirrors.aliyun.com >> %pip_file%
  12. )
  13. @echo on
  14. ::查看已安装的库;
  15. pip list
  16. pip uninstall numpy -y
  17. pip uninstall scipy -y
  18. pip uninstall xlrd -y
  19. pip uninstall matplotlib -y
  20. pip uninstall jsbeautifier -y
  21. :: 普通安装:pip install 模板名
  22. :: 指定版本安装:pip install 模板名==版本
  23. :: 卸载pip uninstall 模板名
  24. pip3 install numpy==1.23.2
  25. pip3 install scipy==1.9.1
  26. pip3 install xlrd==1.2.0
  27. pip3 install matplotlib==3.5.3
  28. pip3 install jsbeautifier==1.14.6
  29. :: 查看numpy的版本;
  30. pip show numpy
  31. :: 安装特定版本库: pip install package==version
  32. :: 更新指定模块: pip install --upgrade package
  33. :: 指定更新源更新版本: pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple package
  34. pause