ToyRobotic
ToyRobotic

Reputation: 597

Python: ModuleNotFoundError: No module named 'Client'

i'm new at python and I got the following error:

ModuleNotFoundError: No module named 'Client'

My project structure is the following:

MyProject:

.. Client(Package)

... Application.py

... main.py

... __init__.py

My code:

"""main.py"""

from Client import Application

app = Application()
app.start()

"""Application.py"""
class Application:

def start(self):
    self.loop()

def loop(self):
    while True:
        pass

Could anyone explain why the interpeter can't find my module?

Upvotes: 2

Views: 11926

Answers (1)

jmonster555games
jmonster555games

Reputation: 66

Kind of just repeating Orange in a way. Your main file is in the same file as the application which your saying is inside the client package but its not its in the same directory as the main.py so its just

import application

Upvotes: 5

Related Questions