statisticsnorway / ssb-fagfunksjoner

Fellesfunksjoner lagd av ressursgruppen for Python
https://statisticsnorway.github.io/ssb-fagfunksjoner/
MIT License
6 stars 0 forks source link

ProjectRoot() not working in .py-files #106

Open akcssb opened 1 week ago

akcssb commented 1 week ago

ProjectRoot() from paths/project_root.py does not work when running from .py file. Only works when used from .ipynb

aecorn commented 6 days ago

You need to add more detail:

aecorn commented 6 days ago

Works in my testing.

Here is my testcode: https://github.com/statisticsnorway/ssb-fagfunksjoner/blob/debug_projectroot_pyfiles/demos/project_root.py

Please provide more information about the situation where it (what?) was not working.

Be aware that Jupyterlab "remembers which folder notebooks were in before they were moved", for quite a long time. Ive had to restart the whole jupyterlab many times, when the notebooks "remember the last folder they were in". Check this with os.getcwd() in the notebook before and after moving it to a different folder... Restarting the kernel is not enough...

image