Installing Jupyter lab
If you have jupyter notebook, but you do not have jupyter lab, you can install it like this:
pip install jupyterlab
from the windows 10 command line or Powershell.
Once you installed it, you can run Jupyter lab from any folder, writing in powershell:
jupyter lab
Then, something like this will appear.
How to use a different version of Python in Jupyter lab
Jupyter lab, evolution of Jupyter notebook is a great tool to use Python code inside the browser, with a lot of enhancement that you can use to join coding in Python with markdown and with the chance to use html and also javascript inside the same page to better explain what you are doing with the code. It is a sort of IDE inside the browser that can also show inside the page widgets, graphics from matplotlib, tables from pandas etc.
Running different version on Python in Jupyter lab
You could have different versions of Python on your computer. If you do not do anything, Jupyter lab will run the default version of Python. Let’s say there is a new version of Python and you install it, making it the default one. If you need to run a different, older, version of Python in Jupyter Lab, you can do write the code that you see in the next image.
On my computer, for example, I have the version 3.6 (as default version) and also the new 3.7 version. Here is an example of use of the new dataclassee in Python 3.7, that I can’t use in versio 3.6.
%%script C:\Users\Utente\AppDAta\Local\Programs\Python\Python37\python.exe from dataclasses import dataclass @dataclass class Data: name: str age: int def printData(self): print(f'I am {self.name}') print(f'My age is {self.age}') a1 = Data("John", 35) a1.printData()
Video
Here is the video that shows you how to start different version of Python in Jupyter lab.
%