Include files in a notebook


#1

Hi,

I’m wondering if it’s possible to:

  • git clone a library on a collab and somehow add the files to the path and use them (I managed to do only git clone…)
  • include functions from a notebook stored in a .py file (let’s say helper functions in a helper.py, in the same storage path)

Thanks,
András


#2

Hi Andras,

If the libraries are Python libraries you can pip install [0] them in your container. Pip even supports git remote urls [1], so no need to clone beforehand.

For the second question, I am not sure if I understand correctly, since a notebook file is essentially a json file.

[0] Execute !pip install foo in a notebook cell
[1] https://pip.pypa.io/en/stable/reference/pip_install/#git

Cheers,
Akos