Forum Discussion
library installation issue pyenv vs cluster-env
- Anonymous1 year ago
Hi smpa01 ,
You're currect, using a custom environment does introduce performance overhead:
Library publishing takes approximately 20 minutes, as the environment needs to be built and distributed across the cluster. Session startup can take around 5 minutes, especially if the environment includes multiple or large dependencies.
To manage this efficiently, we use hybrid approach:
- Use the custom environment for stable, shared libraries that are unlikely to change frequently (e.g., termcolor, numpy, pandas). This ensures consistency across notebooks without frequent rebuilds.
- Install fast-changing or notebook-specific libraries (like aiofiles) using %pip install in the first cell of the notebook. This avoids the need to republish the entire environment for every update.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.
Thank you.
Can you give me a screnshot of this part
3. Attach it via Workspace > Libraries > Add.
Hi smpa01 ,
Here is the screenshot showing how to attach a .whl file via:
Workspace > Libraries > Add > Custom Library
As shown above, after uploading the library, make sure to click “Publish” (top right) to finalize the changes. Only then will the custom library become available across all notebooks in the workspace.
Thank you.
- smpa011 year ago
Community Champion
The exact screen is not available to me cause Workspace > Libraries > Add > Custom Library is blocked by IT.
However, I can do probaly the same thing by creating a custom environment and by uploading the .whls there. I can attach the custom env to all my notebooks.
However,
do I understand
that I still need to run `%pip install termcolor` on the top cell of the notebook(NB1) (I think that is the case)
or
if it is once installed, it is automatically available in other notebooks (simply `import termcolor`) as well as any other subsequest execution of NB1 without needing `%pip install termcolor` in the top cell (desired).
- Anonymous1 year agoNot applicable
Hello smpa01 ,
Thanks for the clarification, you're absolutely on the right track with your approach.
When you create a custom environment and add the termcolor package by uploading its .whl file during setup, the package becomes a built-in part of that environment. This means you don’t need to run %pip install termcolor every time just attaching the environment to your notebook is enough.
You can simply use import termcolor and it will work right away. This applies to any notebook using the same environment, now or in the future, making it a consistent and hassle-free setup. If your access to the Library UI is blocked by IT, using a custom environment is a reliable and practical way to manage shared Python packages across notebooks.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.
Thank you.
- smpa011 year ago
Community Champion
When you create a custom environment and add the termcolor package by uploading its .whl file during setup, the package becomes a built-in part of that environment. This means you don’t need to run %pip install termcolor every time just attaching the environment to your notebook is enough.
You can simply use import termcolor and it will work right away. This applies to any notebook using the same environment, now or in the future, making it a consistent and hassle-free setup.
- this has severe performance implication. I created a cust env with aiofiles and termcolor. Also, The session starts in 5 minutes apart from library publishing takes ~20min (so each cust updates will be ~20 min). Can you please conf?
I am afraid to add more and have a comprehensive cust ENV for all PROD notebooks. If that is the case, I will have to resort to some other option.