I am trying to create a package for my own use and cannot seem to be able to import a class into another folder. Here is a image of my current directory.
I am trying to import a class from strategies.core
into my test/test_symbol.py
file but it keeps giving me an ModuleNotFoundError
Error
Traceback (most recent call last):
File "c:\Users\Francois\Desktop\H4Impulse\test\test_symbol.py", line 6, in <module>
from strategies.core import Symbol
ModuleNotFoundError: No module named 'strategies'
test_symbol.py
import unittest
# import sys
# sys.path.append(r"C:\Users\Francois\Desktop\H4Impulse")
from strategies.core import Symbol
# from ..strategies.core import Symbol <--- this also doesn't work
class TestSymbol(unittest.TestCase):
pass
unittest.main()
it works when I use sys.path.append
to append the path but I feel like this shouldn't be necessary. Any help would be appreciated.