- #1
fog37
- 1,569
- 108
- TL;DR Summary
- understanding the inner workings of jupyter notebook and similar apps
Hello everyone,
As mentioned in past threads, jupyter notebook is a popular application that is used to code in Python (and other languages as well). The jupyter notebook installation includes 3 software components working together:
1) kernel: it interact with the web server
2) server: web server that interacts with the client web app
3) client: web app written in JS that interacts with the browser (i.e. it uses the browser to display)
I read that the web server has 2 roles: be a ZMQ-Websocket bridge (?) and serve as a backend for the browser...
I am confused on how those 3 components work together.....The jupyter notebook server process on the local computer launches the browser that then connects to the server instance. The web server, at the request of the web client, invokes the python interpreter to get its results that are then relayed back to the web client using web protocols. And where is the kernel? The jupyter kernel is iPython (what is that? Isn't it just the previous version of Jupyter notebook to interactively run code?
Does the browser connect to the local server, and the server connects with the jupyter kernel (which is NOT the python interpreter running the Python code), and the kernel connect with the Python interpreter? And the results are then sent back up the chain to the browser to display?
I have created a virtual environment and launched jupyter notebook from it. The notebook opens but I realized that, to use the modules/libraries inside the environment, I need to first create a separate jupyter kernel for that specific environment by installing ipykernel and then creating and naming a new jupyter kernel. I then select the new specific kernel in my notebook and everything works just fine with imports... Why do I need to create a separate jupyter kernel for each different environment? The interpreter being used is the one associated to the active virtual environment...
Thank you!
As mentioned in past threads, jupyter notebook is a popular application that is used to code in Python (and other languages as well). The jupyter notebook installation includes 3 software components working together:
1) kernel: it interact with the web server
2) server: web server that interacts with the client web app
3) client: web app written in JS that interacts with the browser (i.e. it uses the browser to display)
I read that the web server has 2 roles: be a ZMQ-Websocket bridge (?) and serve as a backend for the browser...
I am confused on how those 3 components work together.....The jupyter notebook server process on the local computer launches the browser that then connects to the server instance. The web server, at the request of the web client, invokes the python interpreter to get its results that are then relayed back to the web client using web protocols. And where is the kernel? The jupyter kernel is iPython (what is that? Isn't it just the previous version of Jupyter notebook to interactively run code?
Does the browser connect to the local server, and the server connects with the jupyter kernel (which is NOT the python interpreter running the Python code), and the kernel connect with the Python interpreter? And the results are then sent back up the chain to the browser to display?
I have created a virtual environment and launched jupyter notebook from it. The notebook opens but I realized that, to use the modules/libraries inside the environment, I need to first create a separate jupyter kernel for that specific environment by installing ipykernel and then creating and naming a new jupyter kernel. I then select the new specific kernel in my notebook and everything works just fine with imports... Why do I need to create a separate jupyter kernel for each different environment? The interpreter being used is the one associated to the active virtual environment...
Thank you!