cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically importing packages in notebooks

Kaz
New Contributor II

Within our team, there are certain (custom) python packages we always use and import in the same way. When starting a new notebook or analysis, we have to import these packages every time. Is it possible to automatically make these imports available for all notebooks on a cluster?

4 REPLIES 4

-werners-
Esteemed Contributor III

is it an option to put the imports in a separate notebook and call that notebook using %run?

Kaz
New Contributor II

Definitely already an improvement! But it would be even better if we don't have to type the %run in each notebook.

-werners-
Esteemed Contributor III

I don't see how that is possible as the imports are part of the program.  Somewhere you will have to type them.
Even if it were possible, I would advise against it.  Imports should be stated explicitly and be traceable in case something does not work as expected f.e.

Tharun-Kumar
Honored Contributor II
Honored Contributor II

@Kaz 

You can install these libraries using the Libraries section in the Compute. 

TharunKumar_0-1696567166528.png

All of the libraries mentioned here would be installed whenever the cluster is spun up.