How to Check Python Version in Jupyter Notebook?

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 Jupyter notebook such as “3.7.11”. You can try this yourself in our interactive Jupyter notebook: Check Version Information Using sys … Read more

Python Version Aliases (Alternatives)

To check the Python version in your shell, you can use the following alternatives (aliases): Terminal: The following commands can be used to check the Python version in your terminal. Note that the first and second are aliases whereas the third one provides more information about the built. python –version python -V python -VV Note … Read more

What’s the Difference Between ‘py’ and ‘python’ in the Terminal?

Problem If you run Python in your terminal or shell, you may have realized that there are two ways to do so: using the “python” command and using the “py” command. What’s the difference? Example Say, you want to check your Python version. You can run both commands and the output is different! Here’s using … Read more

Python Check Version of Package with pip

Problem Formulation Assuming you have the Python package manager pip installed in your operating system (Windows, Linux, macOS). How to check the version of a package with pip? Method 1: pip show To check which version of a given package is installed, use the pip show <your_package> command. For example, to check the version of … Read more

How to Find Path Where Python is Installed on Windows?

Windows normally installs Python on one of the two locations: C:\Python39 C:\Users\YourUser\AppData\Local\Programs\Python\Python39 For me, it’s the latter. For you, it may be different—this article shows you how to check for yourself! 🙂 For your convenience, I’ve made a short gif that shows how I rushed through the code on my Windows machine: Before you start, … Read more

How to Check Your TensorFlow Version in Colab?

To check your TensorFlow version in your Jupyter Notebook such as Google’s Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf. print(tf.__version__) This prints the installed TensorFlow version number in the format x.y.z. The following code example uses the dunder attribute … Read more

How to Check the Pandas Version in Your Script?

What is the Pandas Library? The pandas library provides data structures and functionality to represent and manipulate labelled and tabular data. Think of it as like an advanced spreadsheet program in your code with functionality including—but not limited to: creating spreadsheets, accessing individual rows by name, calculating basic statistics over rows and columns, and summing … Read more