Import from repo

Kibour
Databricks Partner

Hi all,

I am trying the new "git folder" feature, with a repo that works fine from the "Repos". In the new folder location, my imports from my own repo don't work anymore. Anyone faced something similar?

Thanks in advance for sharing your experience

Kibour
Databricks Partner

Hi @Retired_mod ,

Thanks for all the suggested options.

I tried again with a brand new git folder. I just changed cluster from DBR 14.2 ML to 14.3 ML, and now the imports work as expected.

Kind regards

View solution in original post

nicole_lu_PM
Databricks Employee
Databricks Employee

Hi from the Git folder product manager - 

If you use DBR 14.3+, the Git folder root is automatically added to the Python `sys.path`. This is documented here. 

Unfortunately we could not backport this behavior to earlier DBR versions. Hope this helps! 

 

 

 

View solution in original post

Yuki
Contributor

Hello,

When I had the same issue even using 14.3+, I tried this codes.

```python

import sys
import pprint

pprint.pprint(sys.path)
```
And I noticed that the path was throwed by old(Legacy) Repos folder. I managed the same name of the folder & Repos.
Then I removed old Repos folder, then it has work.