I have two different Python projects with the same file structure. The first project is:
.algbot_indicators (Project name)
--> src
----> algbot
------> indicators
--------> datasetreader
I created a *whl
file in the first project order to use in the second project. Then, I installed this *whl
into the second project. The second project's file structure is as follows:
.algbot_ai (Project name)
--> src
----> algbot
------> ai
When I try to use a class from the first project, I get an error:
from src.algbot.indicators.datasetreader.DatasetReader import DatasetReader
"cannot find reference indicators ..."
I understand that Python confuses the 2 projects as they start with the same name: src
. When I change one of the projects root folder to "source", the import works. However, this naming convention is the one we always use.
So, how can we import the first project's class into the second without Python confusing? Is there any way or do we have to use different root package name?