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
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap