I am working on some projects these days. I have created 3 executable python files in my project called,
crawler.py
process_data.py
process_csv.py
Then I have created run.py
to execute the above three, one after one.
Problem -: when I tried to execute the process_csv.py
file using run.py
, it showed me
Traceback (most recent call last):
File "processors/process_csv.py", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
Interesting point -: But, if I tried to execute process_csv.py
separately without using run.py
, it was run without any pandas error
.
process_csv.py
import pandas as pd
# my code
run.py
import subprocess
subprocess.run(['python', 'processors/process_data.py']) # this line is working fine
subprocess.run(['python ', 'processors/process_csv.py']) # error occur in this line