How to freeze packages installed only in the virtual environment?

前端 未结 7 917
情歌与酒
情歌与酒 2020-12-23 16:43

How to freeze packages installed only in the virtual environment, that is, without the global ones?

7条回答
  •  一个人的身影
    2020-12-23 16:47

    Only local packages on virtual environment

    pip freeze -l > requirements.txt # or --local instead of -l
    

    Only local packages installed by the user on virtual environment

    pip freeze --user > requirements.txt
    

    See the documentation for further details: https://pip.pypa.io/en/stable/reference/pip_freeze/.

提交回复
热议问题