I have a python folder like this. How to import file1.py in pkg2/file2.py
I tried to import like this in file2.py
`
from pkg1 import file1
` But i got error like this
Could someone help me out.
I have a python folder like this. How to import file1.py in pkg2/file2.py
I tried to import like this in file2.py
`
from pkg1 import file1
` But i got error like this
Could someone help me out.
If you set the PYTHONPATH environmental variable to the root folder, it should work, e.g on Windows:
set PYTHONPATH=. && python pkg2\file2.py