如何冻结仅在虚拟环境中安装的软件包? [英] How to freeze packages installed only in the virtual environment?

查看:125
本文介绍了如何冻结仅在虚拟环境中安装的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何冻结仅安装在虚拟环境中的软件包,即不冻结全局软件包?

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

推荐答案

您需要使用-l--local选项仅冻结本地软件包(而不冻结全局软件包)

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 

在执行pip freeze -l之前,请确保您在virtualenv中工作.

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

这篇关于如何冻结仅在虚拟环境中安装的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆