Hi all, I went through numerous number of articles on how to import python file, but it seem to be working wobbly sometimes in .qmd file. (as is, I made it work a few times, but once the RStudio session was restarted, it didnt work again.)
My file Structure:
SourceReports:
|_ main.py
|_ FunctionSet.py
|_ ReportSourceCodes
.....| init.py
.....| Report 1
..........| init.py
..........| Report1.qmd
......| Report 2
...........| init.py
...........| Report 2.qmd
FunctionSet is where I want to have all of my functions that I would call in each of the Report.qmd file.
According to this tutorial (No known parent package - How relative imports works in python) I need to create a main.py in the root directory so python interpreter knows the location of the file from the root file.
"import FunctionSet" OR "from A_SourceReports import FunctionSet" brings an error of "ModuleNotFoundError: No module named 'FunctionSet'"
Does anyone know where the issue lies here and how to finally import this custom library?
Thanks