I have a flask application running in python 3.6 virtual environment and need to run qiime2 commands from this application. qiime2 is installed inside a miniconda virtual environment. My ubuntu has python 3.6 in /usr/bin, but "which python" returns: /home/****/miniconda3/bin/python which has version 3.7.1
I have used "subprocess.run" to run the qiime2 commands. But some commands (e.g. demux, quality-filter) work and some (e.g. deblur) give the following error:
[Errno 2] No such file or directory: 'deblur'
My subprocess.call is as below:
qiime_runner = '/home/***/miniconda3/envs/qiime2-2018.11/bin/qiime'
cmd = qiime_runner + " " + command_with_args
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
I also tried to manually activate the conda environment as below:
cmd = '/home/****/miniconda3/bin/activate;' + cmd
But still it doesn't work. If I run the command from terminal in the qiime2 conda environment, it works.
We must run the flask application in python environment.
Can anyone please help me with some ideas?
Regards,