@@ -262,11 +262,23 @@ def main():
262
262
if check_conda_env () == True :
263
263
req_file = '%s/data/conda_requirements.yml' % fdogPath
264
264
print ('=> Dependencies in %s' % req_file )
265
+ micromamba_install_cmd = 'micromamba install -c bioconda --file %s -y' % (req_file )
266
+ mamba_install_cmd = 'mamba install -c bioconda --file %s -y' % (req_file )
265
267
conda_install_cmd = 'conda install -c bioconda --file %s -y' % (req_file )
266
268
try :
267
- subprocess .call ([conda_install_cmd ], shell = True )
268
- except :
269
- sys .exit ('\033 [91mERROR: Cannot install conda packages in %s!\033 [0m' % req_file )
269
+ # Try to use micromamba first
270
+ subprocess .check_call (micromamba_install_cmd , shell = True )
271
+ except subprocess .CalledProcessError as e :
272
+ try :
273
+ # If micromamba fails, try mamba
274
+ subprocess .check_call (mamba_install_cmd , shell = True )
275
+ except subprocess .CalledProcessError as e :
276
+ try :
277
+ # If both fail, try conda
278
+ subprocess .check_call (conda_install_cmd , shell = True )
279
+ except subprocess .CalledProcessError as e :
280
+ # If all installation attempts fail, exit with an error message
281
+ sys .exit ('\033 [91mERROR: Cannot install conda packages in %s!\033 [0m' % req_file )
270
282
else :
271
283
install_cmd = 'sudo apt-get install -y -qq <tool>'
272
284
sys .exit ('\033 [91mERROR: Please install these tools manually:\n %s\n using the command: %s!\033 [0m' % (', ' .join (missing_tools ), install_cmd ))
0 commit comments