0

I have a script with the following structure

\-A (git repository 1)
  \-B
   somefile1.py
   __init__.py
setup.py
\-C (git repository 2)
newfile1.py
__init__.py

I want to use somefile1.py in newfile1.py, but I can't find a way to import it.

Both these files are in different levels. I can't change the format of these files. I added from ..A import B in newfile1.py But it didn't work in VS code.Is there any way to import the somefile1.py file?

Ravindran
  • 51
  • 1
  • 4

1 Answers1

0

From what I've understood you have trided this:

from ..A.B import somefile1

That called Relative import, you can learn more about this here`

But in this case absolute import should work too:

from A.B import somefile1