Unknown location error for a module

Im a noobie in this stuff and cant figure out why this is happening that the main.py cannot import from init.py defined app.

Please post code and error messages are text not screen shots.
Use the </> button to do it like this:

```
def main():
     print("Hello")
```

Also you need to use backquote to so that __ are not use to bold text.

It would seem that you do not have a module named website, aka website.py.

C:\Users\User\Desktop\Python projekti\Projekts V1.1>C:/Users/User/AppData/Local/Programs/Python/Python312/python.exe “c:/Users/User/Desktop/Python projekti/Projekts V1.1/main.py”
Traceback (most recent call last):
File “c:\Users\User\Desktop\Python projekti\Projekts V1.1\main.py”, line 1, in
from website import createapp1
ImportError: cannot import name ‘createapp1’ from ‘website’ (unknown location)

What I think is happing is that you have a folder website that is missing the
required website\__init__.py.

You will need to add that missing file.
It can be empty.

What exactly do you mean by “init.py defined app”?

Where you have that code, from website import createapp1, exactly what do you expect it to mean? What part of the code should cause createapp1 to have meaning, and where exactly is that located? Which is to say: exactly what are you expecting to get imported here?

__init__.py files are not required to make packages, since Python 3.3, and both absolute and relative imports can be performed just fine without them. It provides a place to define additional attributes of the package that are not contained modules (in particular, __all__), and it has some influence on the module search algorithm, and it might give some hints to Setuptools for packaging - but it is not at all required.

True. I keep forgetting that.

However to get the OP’s error message the __init__.py must not exist.

Do you have a createapp1.py in website folder? If not that is why the import does gets an error.