I use PyCharm and I'm trying to import a class/module from a script into another script.
My two scripts are in the same directory:
>|-my_directory
>>|--script_A
>>|--script_B
script_A:
class Number:
def __init__(self):
self.var = 1
# some other methods
script_B:
from script_A import *
# some other code
But the issue is, if I run script_B there is an error:
Traceback (most recent call last):
...
from script_A import *
ImportError: attempted relative import with no known parent package
So why this doesn't work? Why is there an error? And how can I fix it?