0

Here is my project structure:

Project
   main.py
   myPackage/
      subfolder1/
         __init__.py
         script11.py
         script12.py
      subfolder2/
         __init__.py
         script2.py

In main.py:

from myPackage.subfolder2 import script2.py

In script2.py:

from ..subfolder1 import script12.myFunction

In __init__.py from subfolder1:

from script11.py import *

and the code breaks at that import and throws the following error:

ModuleNotFoundError: No module named 'script11'

Can someone explain to me what I am doing wrong?

mkrieger1
  • 14,486
  • 4
  • 43
  • 54
FenryrMKIII
  • 860
  • 6
  • 19

1 Answers1

0

As proposed by @Kacper Floriański, changing

from script11.py import *

to

from .script11.py import *

solved my issue

FenryrMKIII
  • 860
  • 6
  • 19