I want to run separately two Python scripts in command line, where the script1.py imports Python modules and the script2.py uses these pre-imported modules to conduct calculations. The reason of doing this is to avoid importing the same modules/model weights/etc (in script1.py) every time I want to run script2.py with different input arguments in bash.
In the command line I run: >> python script1.py
followed by >> python script2.py
and I get this Error: NameError: name 'cv2' is not defined
, while it's supposed to be imported in script1.py.
How can I solve this problem?