How to freeze packages installed only in the virtual environment?

拥有回忆 提交于 2019-12-02 17:55:36
Muneeb Ali

You need to use the -l or --local option to freeze only the local packages (and not the global ones)

pip freeze -l > requirements.txt 

Make sure you are working in the virtaualenv before doing pip freeze -l.

Bitcoin Mexico

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/.

César

Install whatever you need to freeze in your virtual environment, and then

pip freeze > requirements.txt

After that install the packages in the virtual environment that you do not want to freeze.

Dima Bildin

Try the following command:

pip -E /path/to/env/ freeze
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!