How to freeze packages installed only in the virtual environment?

前端 未结 7 933
情歌与酒
情歌与酒 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:45

    I'm on Windows 10, python 3.6, with my virtual environment called env activated using command prompt I found that pip freeze -l does not work (error), python -m pip freeze -l does not work (gets global packages) but changing into my virtual environment Scripts directory and running pip freeze or pip freeze -l works. Here is an example of this solution/work-around with my virtual environment, env:

    cd \env\Scripts
    pip freeze > ..\..\requirements.txt
    

提交回复
热议问题