Hello All,
I am curious to know, how does Cognite follows containerization practices.
Can we create and use virtual environment in CDF jupyter notebook?
I had installed (%pip install) some packages in my notebook and used it for a while. Surprisingly in next session (Notebook restart / kernel restart) it is giving error as ‘package not found’.
Containerization Practice in CDF Jupyter Notebook
Hi,
Thanks for asking this question and using our Jupyter Notebook service. The Jupyter Notebook in Cognite Data Fusion is based on a browser only Pyodide kernel where everything runs inside your browser. The way it works is that each Python kernel starts from scratch, so all packages have to be installed each time in a cell using %pip install mypackage which usually is really fast.
There is no state between sessions you can rely on.
Hope this helps!
![Cognite InField Practitioner Badge](https://uploads-eu-west-1.insided.com/cognite-en/attachment/8bbc7b98-0b37-45e0-b920-d026908810f3_thumb.png)
Hi Andres,
I have subsequent question to this:
- Does that mean - we do not use any CDF compute resources?
- As stated, ‘Python Kernel starts freshly every time’ - then every time I need to INSTALL the library in same notebook. Is this correct ?
Correct! No Cognite compute resource is used for notebooks, only your browser.
And yes, add a cell with the packages you want to install to ensure that the notebook has what it needs. Installing is quite fast (faster than installing locally on the computer normally).
Hi
We are following up to see whether you're satisfied with the responses you've received?
Hi
Did the information provided above assist you in addressing your query?
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.