def env_exists(name=None, prefix=None):
 if (not prefix):
  command = ("conda info -e | grep -e '^%(name)s\\s'" % locals())
 else:
  if name:
   base = prefix
  else:
   prefix = utils.abspath(prefix)
   (base, name) = (prefix, '')
   while (name == ''):
    (base, name) = os.path.split(base)
  command = ("CONDA_ENVS_PATH=%(base)s conda info -e | grep -e '^%(name)s\\s'" % locals())
 with settings(hide('running', 'warnings', 'stderr', 'stdout'), warn_only=True):
  res = run(command, shell_escape=False)
  return res.succeeded

def env_exists ( name = None , prefix = None ) : if ( not prefix ) : command = ( "conda info -e | grep -e '^%(name)s\\s'" % locals ( ) ) else : if name : base = prefix else : prefix = utils . abspath ( prefix ) ( base , name ) = ( prefix , '' ) while ( name == '' ) : ( base , name ) = os . path . split ( base ) command = ( "CONDA_ENVS_PATH=%(base)s conda info -e | grep -e '^%(name)s\\s'" % locals ( ) ) with settings ( hide ( 'running' , 'warnings' , 'stderr' , 'stdout' ) , warn_only = True ) : res = run ( command , shell_escape = False ) return res . succeeded
check if a conda environment exists .