Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12201

Problem with importing Python module in VsCode

$
0
0

I'm learning Python and wanted to make a snack store management application.When I try to import authenticate logic, it shows the following error:

Traceback (most recent call last): File "/Users/mac/Dev/Learn_python/btl/snack_app/source_code/views/login_screen.py", line 5, in <module>import source_code.controllers.authenticate as auth ModuleNotFoundError: No module named 'source_code'

My import code looks like this:import controllers.authenticate as auth

I use Venv and in the image is the structure of the projectThe code structure

I think vscode confirmed the module exists because it shows green in the code like thisVSCode confirm

I don't know what's wrong.

I tried adding source_code.controllers and the error became ModuleNotFoundError: No module named 'source_code'.

I activated Venv (If that matters).


Viewing all articles
Browse latest Browse all 12201

Trending Articles