Skip to main content
Solved

Containerization Practice in CDF Jupyter Notebook


Forum|alt.badge.img+3

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’.

 

Best answer by Dilini Fernando

Hi @Ankit Kothawade,

I hope the issue has been resolved. I'm closing this topic for now. Please feel free to start a new post if you have any questions. 

View original
Did this topic help you find an answer to your question?

6 replies

Anders Hafreager
Practitioner

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!


Forum|alt.badge.img+3

Hi Andres, 

I have subsequent question to this:

  1.  Does that mean - we do not use any CDF compute resources? 
  2. As stated, ‘Python Kernel starts freshly every time’ - then every time I need to INSTALL the library in same notebook. Is this correct ? 
     

Anders Hafreager
Practitioner

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).


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2

Hi @Ankit Kothawade,

We are following up to see whether you're satisfied with the responses you've received? 


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2

Hi @Ankit Kothawade,

Did the information provided above assist you in addressing your query?


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • 671 replies
  • Answer
  • August 30, 2024

Hi @Ankit Kothawade,

I hope the issue has been resolved. I'm closing this topic for now. Please feel free to start a new post if you have any questions. 


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings