ModuleNotFoundError is haunting me again. Whats wrong with my folder structure? /u/domanpanda Python Education

Whenever i get some longer break from python (year or more) i deal with this one python annoyance.

Folder structure (simplified)

start.py myproj/ Classes/ __init__.py MainWindow.py Core/ __init__.py ConfigClass.py 

start.py

from myproj.Classes.MainWindow import * if __name__ == "__main__": root_tk_obj = Tk() main_window_obj = MainWindow(root_tk_obj) 

MainWindow.py

from Core.ConfigClass import * ...the rest of code... 

Vscode with python extension suggests me Core.ConfigClass but when i run the start.py i get

ModuleNotFoundError: No module named 'Core' 

PS. I really would like to keep this folder structure as there are more files than shown here.

submitted by /u/domanpanda
[link] [comments]

​r/learnpython Whenever i get some longer break from python (year or more) i deal with this one python annoyance. Folder structure (simplified) start.py myproj/ Classes/ __init__.py MainWindow.py Core/ __init__.py ConfigClass.py start.py from myproj.Classes.MainWindow import * if __name__ == “__main__”: root_tk_obj = Tk() main_window_obj = MainWindow(root_tk_obj) MainWindow.py from Core.ConfigClass import * …the rest of code… Vscode with python extension suggests me Core.ConfigClass but when i run the start.py i get ModuleNotFoundError: No module named ‘Core’ PS. I really would like to keep this folder structure as there are more files than shown here. submitted by /u/domanpanda [link] [comments] 

Whenever i get some longer break from python (year or more) i deal with this one python annoyance.

Folder structure (simplified)

start.py myproj/ Classes/ __init__.py MainWindow.py Core/ __init__.py ConfigClass.py 

start.py

from myproj.Classes.MainWindow import * if __name__ == "__main__": root_tk_obj = Tk() main_window_obj = MainWindow(root_tk_obj) 

MainWindow.py

from Core.ConfigClass import * ...the rest of code... 

Vscode with python extension suggests me Core.ConfigClass but when i run the start.py i get

ModuleNotFoundError: No module named 'Core' 

PS. I really would like to keep this folder structure as there are more files than shown here.

submitted by /u/domanpanda
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *