Python requirements.txt的使用方法

转载 https://blog.csdn.net/weixin_41407477/article/details/86090430

 

在使用Python的时候,需要把安装的Package通过requirements.txt 给导出来,让其他使用者更加方便的安装:

在当前环境执行生成文件:

pip freeze >requirements.txt

生成后的requirements.txt文件是:

  1.  
    pytest==3.8.0
  2.  
    pytest-allure-adaptor==1.7.10
  3.  
    requests==2.18.1

在新的系统下执行下面的命令安装:

pip install -r requirements.txt

在新的console 通过下面的命令来检查:

pip list
posted on 2021-08-11 10:12  该用户很懒  阅读(252)  评论(0编辑  收藏  举报