Automatically importing packages in notebooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 02:19 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 04:52 AM
is it an option to put the imports in a separate notebook and call that notebook using %run?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 05:44 AM
Definitely already an improvement! But it would be even better if we don't have to type the %run in each notebook.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 06:42 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 09:40 PM
You can install these libraries using the Libraries section in the Compute.
All of the libraries mentioned here would be installed whenever the cluster is spun up.

