First of all, here's the look of my project :
/
scriptA.py
scriptB.py
/redist/
/mod1/
/setup.py
Here's a quick detail of what's going on :
scriptA.py
import scriptB
def install_MyMod():
#some code that install mod1 in the python3 /dist-packages
def other_Stuff():
return scriptB.stuff()
OR, the problem is that scriptB needs mod1 to run :
scriptB.py
import mod1 as mm
def stuff():
return mm.some_Function()
The issue is that whenever I launch scriptA, I got an error saying that scriptB cannot import mod1, which is logicial since my first script is supposed to install it, and then call the other script which will use it.
Is there a way to avoid this error ?
Thanks
Don't
import scriptB
until you need it. E.g., put theimport
statement inside theother_Stuff()
function: