@@ -448,15 +448,18 @@ def __init__(self, parent=None):
448448 self .old_version = None
449449 # we are using the installer version of the env
450450 self .conda_prefix = os .getenv ("CONDA_PREFIX" )
451- self .command = os .path .join (self .conda_prefix , 'bin' , "conda" )
452- mamba_cmd = os .path .join (self .conda_prefix , 'bin' , 'mamba' )
453- # Check if mamba is installed in the env
454- try :
455- subprocess .run ([mamba_cmd ], startupinfo = subprocess_startupinfo (),
456- stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
457- self .command = mamba_cmd
458- except FileNotFoundError :
459- pass
451+ if self .conda_prefix is not None :
452+ self .command = os .path .join (self .conda_prefix , 'bin' , "conda" )
453+ mamba_cmd = os .path .join (self .conda_prefix , 'bin' , 'mamba' )
454+ # Check if mamba is installed in the env
455+ try :
456+ subprocess .run ([mamba_cmd ], startupinfo = subprocess_startupinfo (),
457+ stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
458+ self .command = mamba_cmd
459+ except FileNotFoundError :
460+ pass
461+ else :
462+ self .command = "conda"
460463
461464 # pyqtSignals don't work without an application eventloop running
462465 if QtCore .QCoreApplication .startingUp ():
0 commit comments