0

I have a project structured as follow:

project\
   __init__.py
   gui\
      __init__.py
      gui_file_one.py
      gui_file_two.py
   logic\
      __init__.py
      logic_file_one.py
      logic_file_two.py

Let's say that in a gui_file_one.py I need to import class A that is located in a logic_file_one.py. When I try to do from logic.logic_file_one import A I get a ModuleNotFoundError: No module named 'logic'. How do I overcome this? How should this class be imported?

Jakub Sapko
  • 304
  • 2
  • 15
  • Please show some code to go with your verbal description. – Code-Apprentice Jan 10 '23 at 16:28
  • Can you add your importing statement? And how you run your script, directly or by calling it from another location? – SWEEPY Jan 10 '23 at 16:39
  • I think this question have [duplicate](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – Jurakin Jan 10 '23 at 16:41
  • Does this answer your question? [Importing files from different folder](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – Jurakin Jan 10 '23 at 17:00

0 Answers0