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
  • 19,194
  • 5
  • 54
  • 65
FenryrMKIII
  • 1,068
  • 1
  • 13
  • 30
  • `from .script11 import *` will fix your error. Pretty sure there will be more errors, but you should be able to figure those out. – Kacperito Jan 20 '20 at 14:20

1 Answers1

0

As proposed by @Kacper Floriański, changing

from script11.py import *

to

from .script11.py import *

solved my issue

FenryrMKIII
  • 1,068
  • 1
  • 13
  • 30