I think it is an environment issue, but I am new to linux.
I try to run subprocess.run('multiqc .') in pycharm but it shows me the file is not found
FileNotFoundError: [Errno 2] No such file or directory: 'multiqc .'
and echo $PATH
shows that anaconda path is exposed
$ echo $PATH
/media/SSD1T/Software/anaconda3/bin:
I tried subprocess.run('multiqc', shell = True)
, it returns error: /bin/sh: 1: multiqc: not found
while in terminal, I can call multiqc
no problem
$which multiqc
/media/SSD1T/Software/anaconda3/bin/multiqc
tried run other commands in pycharm, no problem:
subprocess.run('ls')
In[11]: subprocess.run("ls")
loadSamples.py
venv
xFastqc.py
xTrim.py
Out[11]: CompletedProcess(args='ls', returncode=0)
The only way I can make it work is to add the whole path to subprocess.run
In[12]: subprocess.run("/media/SSD1T/Software/anaconda3/bin/multiqc")
Usage: multiqc [OPTIONS] <analysis directory>
Error: Missing argument "analysis_dir".
This is MultiQC v1.5
For more help, run 'multiqc --help' or visit http://multiqc.info
Out[12]: CompletedProcess(args='/media/SSD1T/Software/anaconda3/bin/multiqc', returncode=2)
My question is: how can I just call multiqc
in subprocess.run
without put in the whole path?
Thank you