from platform import python_version

print(python_version())

This will give you the exact version of python running your script. eg output:

3.6.5
Answer from Davies Odu on Stack Overflow
🌐
Saturn Cloud
saturncloud.io › blog › how-to-know-which-python-is-running-in-jupyter-notebook
How to Know Which Python is Running in Jupyter Notebook? | Saturn Cloud Blog
January 22, 2024 - To check the kernel information, you can run the following command in a code cell in Jupyter Notebook: ... This will print the current Python version being used by the kernel in Jupyter Notebook.
Discussions

I want to use jupyter lab with python 3.9 not python 3.8
Ok, I found the solution I think. I'll try to explain as best as I can. How to use Jupyter Lab in a specific python version. Note: Read and understand before doing it to prevent any mistake Open a command prompt with "Windows key + R" and type in "cmd" and hit "Enter". In the command prompt check your python version with py -V and python - V if the versions are different and you want to set a specific version as the default one, you may need to uninstall Jupyter Lab and Notebook that are installed on the unwanted Python version with (Note: this may be a facultative step, let me know) py -3.8 -m pip uninstall notebook juyterlab As you can see "-3.8", you should change the numbers to the python version that Jupyter Lab and Notebook are installed on and use THAT YOU DON'T WANT. or pip uninstall notebook juyterlab then open the Windows Search Bar to search and access "Advanced System Settings" and then click "Environment Variables" under the "Advanced tab". On the Environment Variables dialog, you’ll see two sets of variables: one for "user variables" and the other for "system variables". Both lists have the PATH variable, so you have to decide which one to edit. see: How to Add to Windows PATH Environment Variable (helpdeskgeek.com) How to add Python to PATH in Windows 10 (configserverfirewall.com) The python version that you want to use as the default version should be on top of the unwanted version in PATH. Close your command prompt, re-launch a new one, and re-check your python version as quoted earlier. If they are the same and both show the one you want, then reinstall Jupyter Lab and Notebook with py -3.9 -m pip install notebook juyterlab (Again change the numbers according to the python version THAT YOU NOW WANT) or pip install notebook juyterlab And voilà, it should be done now! Hope this helped, if you have any suggestions please do comment. More on reddit.com
🌐 r/IPython
3
6
November 15, 2020
What Python version?
Hi:-) Installed Jupyter on Ubuntu Linux. looking on my linux intalation found that it came with Python 2.7 but the latest is 3.8. I don’t know if Jupyter caught up to 3.8 or should I use a lower Python 3x version. Any help will be much appreciated. More on discourse.jupyter.org
🌐 discourse.jupyter.org
0
0
April 24, 2020
How to check Python version in Conde environment
You can use conda list python which will display all the packages in your conda environment that include the keyword python and their version. More on reddit.com
🌐 r/learnpython
1
2
October 25, 2023
How to version control Jupyter notebook?
https://jupytext.readthedocs.io/en/latest/ You’ll need to put things in a script eventually, but when you’re in that awkward stage where you’re still experimenting but you’ve written some reasonably hefty code this is golden. You can use git with the associated .py file to keep track of it. More on reddit.com
🌐 r/datascience
118
95
February 20, 2024
🌐
Deepnote
deepnote.com › guides › jupyter › how-to-check-the-python-version-in-jupyter
How to check the Python version in Jupyter
March 6, 2024 - Click on a cell to activate it or create a new one. ... Press `Shift+Enter` to execute the cell. The output will display your current Python version, along with additional details about the build.
🌐
Saturn Cloud
saturncloud.io › blog › how-to-know-which-python-is-running-in-your-jupyter-notebook
How to Know Which Python is Running in Your Jupyter Notebook | Saturn Cloud Blog
October 21, 2023 - The easiest ways to determine the Python version running in your Jupyter notebook is to use the built-in sys module. The sys module provides access to some variables used or maintained by the interpreter and functions that interact with the ...
🌐
Pierian Training
pieriantraining.com › home › python tutorial: how to check python version in jupyter notebook
Python Tutorial: How to check Python version in Jupyter Notebook - Pierian Training
April 28, 2023 - This information can be useful when developing Python applications that need to be compatible with specific Python versions. Another way to check the Python version in Jupyter Notebook is by using the built-in `platform` module.
🌐
DEV Community
dev.to › linediconsine › how-to-determine-which-python-version-your-jupyter-notebook-is-using-3hnl
How to determine which Python version your Jupyter notebook is using - DEV Community
June 9, 2023 - All you need to do is run the following code block in your Jupyter Notebook: import sys print(sys.executable) print(sys.version) print(sys.version_info) This will return information about the version of Python being used, as shown below:
🌐
Skytowner
skytowner.com › explore › checking_python_version_used_in_jupyter_notebook
Checking Python version used in Jupyter Notebook
To check the Python version used in Jupyter Notebook, run the command !python -V in the notebook.
Find elsewhere
🌐
GitHub
gist.github.com › bimal2810 › 8f25ed7e68e4a994d39545cd1102747b
Check python version on a Jupyter notebook #jupyter · GitHub
Save bimal2810/8f25ed7e68e4a994d39545cd1102747b to your computer and use it in GitHub Desktop. Download ZIP · Check python version on a Jupyter notebook #jupyter · Raw · check_version.py · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
🌐
Finxter
blog.finxter.com › home › learn python blog › how to check python version in jupyter notebook?
How to Check Python Version in Jupyter Notebook? - Be on the Right Side of Change
July 14, 2022 - To check the Python version in your Jupyter notebook, first import the python_version function with “from platform import python_version“. Then call the function python_version() that returns a string with the version number running in your ...
🌐
Cantech
cantech.in › home › how to check python version on windows, linux, and macos
How to Check Python Version on Windows, Linux, and MacOs
July 24, 2024 - To check the Python version in VS Code, open a Python file and select the Python interpreter in the bottom left corner of the editor. The version number will be displayed next to the interpreter name. In Jupyter Notebook, you can find the Python version by opening a new notebook and executing the following code in a cell:
🌐
HAR Data Extractor
jonathansoma.com › course › foundations-2021 › changing-jupyter-python
Changing the Python version Jupyter uses
When I say “shut down your Jupyter notebook server,” I don’t mean close your notebook tab: that isn’t enough! You need to actually turn off and restart the entire Jupyter server. Use Ctrl+C to shut it down from the command line. If we’re nosy or suspicious, we could actually look at the kernel’s details. Read the last line of the output to see where the kernelspec (kernel specification) lives: $ python -m ipykernel install --user Installed kernelspec python3 in /Users/soma/Library/Jupyter/kernels/python3
🌐
SuperOps
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
4 days ago - You can also type the command “python –version” in the Terminal by going to "View" and then "Integrated Terminal." 3. Jupyter Notebook · Open a new notebook · Execute this code: import sys · print (sys. version) The output will be the ...
🌐
w3resource
w3resource.com › python-exercises › python-basic-exercise-2.php
Check Python version - w3resource
May 17, 2025 - A tuple containing the five components of the version number: major, minor, micro, releaselevel, and serial. All values except releaselevel are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0).
🌐
GeeksforGeeks
geeksforgeeks.org › python › update-jupyter-notebook-to-the-latest-python-version
Update Jupyter Notebook to the Latest Python Version - GeeksforGeeks
July 23, 2025 - Use pip to update Jupyter Notebook: ... Run the same code as in current python version checking to check if Jupyter Notebook is now using the latest Python version.
🌐
Reddit
reddit.com › r/ipython › i want to use jupyter lab with python 3.9 not python 3.8
r/IPython on Reddit: I want to use jupyter lab with python 3.9 not python 3.8
November 15, 2020 -

Hi!

I'm pretty much just a Jupyter noob so here's my problem,

when I run "jupyter lab" in a cmd to launch Jupyter Lab it tells me

    [I 22:53:15.258 LabApp] JupyterLab extension loaded from c:\users\<my_user>\appdata\local\programs\python\python38\lib\site-packages\jupyterlab
    [I 22:53:15.258 LabApp] JupyterLab application directory is c:\users\<my_user>\appdata\local\programs\python\python38\share\jupyter\lab

and it runs my python 3.8.X version.

https://preview.redd.it/ndgs69moehz51.png?width=1431&format=png&auto=webp&s=a12becaf7953006f6db94c3562aaea3415c4baaa

I want to change the default app directory (--app-dir) to the "appropriate" folders in python39 instead of python38 for example

c:\users\<my_user>\appdata\local\programs\python\python39\share\jupyter\lab

but these "appropriate" folders don't exist in python39.

What do I have to do?

UPDATE : I got to know anaconda better, more or less, as u/sideOil suggested and it makes it so much easier to keep your python packages updated.

Top answer
1 of 1
1
Ok, I found the solution I think. I'll try to explain as best as I can. How to use Jupyter Lab in a specific python version. Note: Read and understand before doing it to prevent any mistake Open a command prompt with "Windows key + R" and type in "cmd" and hit "Enter". In the command prompt check your python version with py -V and python - V if the versions are different and you want to set a specific version as the default one, you may need to uninstall Jupyter Lab and Notebook that are installed on the unwanted Python version with (Note: this may be a facultative step, let me know) py -3.8 -m pip uninstall notebook juyterlab As you can see "-3.8", you should change the numbers to the python version that Jupyter Lab and Notebook are installed on and use THAT YOU DON'T WANT. or pip uninstall notebook juyterlab then open the Windows Search Bar to search and access "Advanced System Settings" and then click "Environment Variables" under the "Advanced tab". On the Environment Variables dialog, you’ll see two sets of variables: one for "user variables" and the other for "system variables". Both lists have the PATH variable, so you have to decide which one to edit. see: How to Add to Windows PATH Environment Variable (helpdeskgeek.com) How to add Python to PATH in Windows 10 (configserverfirewall.com) The python version that you want to use as the default version should be on top of the unwanted version in PATH. Close your command prompt, re-launch a new one, and re-check your python version as quoted earlier. If they are the same and both show the one you want, then reinstall Jupyter Lab and Notebook with py -3.9 -m pip install notebook juyterlab (Again change the numbers according to the python version THAT YOU NOW WANT) or pip install notebook juyterlab And voilà, it should be done now! Hope this helped, if you have any suggestions please do comment.
🌐
Jupyter Community Forum
discourse.jupyter.org › general
What Python version? - General - Jupyter Community Forum
April 24, 2020 - Hi:-) Installed Jupyter on Ubuntu Linux. looking on my linux intalation found that it came with Python 2.7 but the latest is 3.8. I don’t know if Jupyter caught up to 3.8 or should I use a lower Python 3x version. Any help will be much appreciated.
🌐
ML Journey
mljourney.com › home › check python version in jupyter notebook – a complete guide
Check Python Version in Jupyter Notebook – A Complete Guide - ML Journey
September 8, 2025 - Now when you open Jupyter Notebook, you’ll be able to choose “Python (myenv)” as your kernel. ... You can explicitly install that version (e.g., Python 3.9), create a virtual environment with it, and register it as a separate kernel. This allows precise control. If you’re working in a collaborative setting, add a version check cell at the top of your notebooks:
🌐
Code2care
code2care.org › home › howto › how to check python version in jupyter notebook
How to Check Python Version in Jupyter Notebook | Code2care
August 11, 2023 - If you are using Jupyter Notebook on your device locally and want to know what version of Python has been used, you can try one of the below options.
🌐
Learning Lab
learninglabb.com › home › data analytics › which jupyter notebook version is best? what version of python is supported by jupyter?
Which Jupyter Notebook Version Is Best? What Version Of Python Is Supported By Jupyter?
October 1, 2024 - Use the command python –version to check which Python version Jupyter Notebook will be using. At the end of the day, choosing which Jupyter Notebook version is best depends on your specific needs.