'Python, can't import file from another folder

Structure:

folder "a":
     __init__.py
     car.py
folder "b":
     tad.py

And I do in tad.py:

from a.car import *


ModuleNotFoundError: No module named 'a'

What can I do?? EDIT: I added init to the top level folder, and now throws this error:

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000031bc (most recent call first):
<no Python frame>


Solution 1:[1]

You should try

from .a.car import *

The leading dot goes one directory up in folder hierarchy.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wasif