linux在python的虚拟环境下运行程序,如何列出Linux中的所有python虚拟环境?

I have more than one Python environment configured in my Debian OS. Is there a way to list all configured environments in Linux?

This is different from the possible duplicate as indicated in the comment below. I mean virtual environments created using virtualenv only.

解决方案

If only using the lowly virtualenv ...{directory} to create a virtualenv, then there is just some directory somewhere that has that specific environment in it. You can only "list" these by running find on your $HOME directory (or any other list of directories you might have used to create virtualenvs) looking for python installations. Hopefully some convention was followed like storing them all in ~/virtualenvs. (See also Where should virtualenvs be created? )

If using virtualenvwrapper, then as mentioned, use the command lsvirtualenv to list envs that were created with mkvirtualenv. They are all in ~/.virtualenvs by default. See https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html

If using conda, you can list virtual envs created via conda create --name {my_env} [...], using either conda info --envs or conda env list. See https://conda.io/docs/using/envs.html#list-all-environments

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值