0

I'm trying to import a .py file named 'main' within the same directory as my main file.

from .settings import *

When I run it I get this error

    Traceback (most recent call last):
      File "C:/Users/user_1/Desktop/Projects/program/main.py", line 5, in <module>
        from .settings import *
    ModuleNotFoundError: No module named '__main__.settings'; '__main__' is not a package

Why isn't this working and how do I fix it?

Nathan
  • 1

1 Answers1

0

You need to have the package in library folder of python. For me keeping any module inside this directory works

C:\Program Files\Anaconda3\Lib\site-packages
Md Sifatul Islam
  • 846
  • 10
  • 28