How to Check Python Version in Jupyter Notebook

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.

Option 1: Using sys module

    Add the below line of code into one of the cells and execute.

    import sys
    print(sys.version)
    
    Output:

    3.11.4 (main, Jul 25 2023, 17:36:13) [Clang 14.0.3 (clang-1403.0.22.14.1)

    As we can see from the output, I am using Python version 3.11.4 with my Notebook.

    Sys module to know Python Version Jupyter Notebook

Option 2: Running Python --version Command in Notebook

    Another way is by making use of the command - python --version in a cell.

    !python3 version
    !python version
    Python3 version in Jupyter Notebook

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!