How to import Python module

lchunleo
Level 2
How to import Python module

Hi 

 i understand that i can import a github codes into my DSS project. i also understand that i can import python code from the project. My question is given the following structure, how can i import the codes from the tools (by importing the entire git) instead of git importing individual folder (src, tools) to call the python modules:

test project

- src codes (consist of main python codes)

- tools (helper tools written in python codes)

0 Kudos
3 Replies
Liev
Dataiker Alumni

Hi @lchunleo 

In your project libraries you can ask DSS to git pull from a repository. This can be done by either requesting the full repo or a subdirectory within it, up to you.

It will be copied at the root level of the project libraries.

Good luck!

0 Kudos
lchunleo
Level 2
Author

thank you Liev, actually i had no issue pulling the entire repo. just that i have python modules that are packaged in different folders where a) python module in one folder need to call python module in another folder or b) python module in the root module need to call python module in a folder. i have __init__.py in all the folders. just wondering why it does not work when i pull the entire repo and try option (a) as mentioned above. if you know my issue, could you advise me? sorry am new to dataiku

0 Kudos
Ignacio_Toledo

Hi @lchunleo. When you use this repo in your local python environment (outside DSS), how do you install it, or make it available to python?

0 Kudos
A banner prompting to get Dataiku DSS
Public