Check If A Module Is Installed In Python

In this article, we’ll see a simple way to check if a module has been installed in Python or not

You can check if a module is installed on your device or not by running the command shown below on your command line interface. (command prompt or Powershell if you are on Windows, and the terminal app if you are on Mac or Linux)

pip show <module-name>

Be sure you replace <module-name> with the right one! For example, in my case, I would type in

pip show pandas

and I got the following result

That was a quick one!

For the next step in your Python journey I invite you to master some of the most common errors you will run into in your daily life as a Python developer. We have compiled a list of just 7 exceptions that you need to focus on if you wish to gain mastery of Exceptions in Python!

7 Most Common In-Built Exceptions in Python!

If you are a visual learner here is a YouTube video that we made on that same topic!

I hope that was helpful!

Here are some other helpful articles.

Related Articles

ModuleNotFoundError: A Step By Step Troubleshooting Guide!

7 Most Common In-Built Exceptions in Python!

Python Exceptions: Explained for Beginners!

Python: When To Use Custom Exceptions? Explained!

Python TypeError: A Step By Step Troubleshooting Guide!

Thanks to Namazi Jamal for his contributions in writing this article!

Photo of author
Editor
Balaji Gunasekaran
Balaji Gunasekaran is a Senior Software Engineer with a Master of Science degree in Mechatronics and a bachelor’s degree in Electrical and Electronics Engineering. He loves to write about tech and has written more than 300 articles. He has also published the book “Cracking the Embedded Software Engineering Interview”. You can follow him on LinkedIn