You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have gdoc.py in the same directory as tarbell_config.py. I can import it, but another member of my team cloned the repo and hit an import error when running tarbell serve from that directory. I've run into this before, and it's easy enough to resolve by adding the project root to sys.path:
importosimportsys# do this before importing gdocPROJECT_ROOT=os.path.realpath(os.path.dirname(__file__))
sys.path.append(PROJECT_ROOT)
fromflaskimportBlueprint, gfromtarbell.oauthimportget_drive_apifromgdocimportDocumentSource
But it's another step, and it's a pain, and it's not documented. So, I think the best solution is adding directory containing tarbell_config.py to sys.path in TarbellSite.load_project, but I haven't tried this yet. (Some part of the problem seems to depend on how you organize virtual environments, so that's another little complication.) This would make adding extra Python files more seamless.
The text was updated successfully, but these errors were encountered:
In a recent project, I have a Python file in my project directory that gets imported in
tarbell_config.py
:I have
gdoc.py
in the same directory astarbell_config.py
. I can import it, but another member of my team cloned the repo and hit an import error when runningtarbell serve
from that directory. I've run into this before, and it's easy enough to resolve by adding the project root tosys.path
:But it's another step, and it's a pain, and it's not documented. So, I think the best solution is adding directory containing
tarbell_config.py
tosys.path
inTarbellSite.load_project
, but I haven't tried this yet. (Some part of the problem seems to depend on how you organize virtual environments, so that's another little complication.) This would make adding extra Python files more seamless.The text was updated successfully, but these errors were encountered: