Vincent Roye
Vincent Roye

Reputation: 2851

django-admin command : ModuleNotFoundError: No module named 'mysite'

I have seen multiple post about that problem but I still can't fix it.

I have tried:

set DJANGO_SETTINGS_MODULE=mysite.settings.dev

but when I try

django-admin test

I get that error message:

ModuleNotFoundError: No module named 'mysite'

I also tried to add the variable to my environment variables (that works) but I keep receiving that error.

Here's where my settings file is located (dev imports base).

enter image description here

Upvotes: 0

Views: 524

Answers (2)

user1960422
user1960422

Reputation: 569

Add your project's absolute path to environment variable PYTHONPATH

PS > $env:PYTHONPATH += ";d:/Github/django-labs"

Upvotes: 1

Bli
Bli

Reputation: 71

Could you be missing a init.py file inside the mysite folder? Can't see that from the photo

Upvotes: 0

Related Questions