Open In App

Find Installed Python Package Version Using Pip

Last Updated : 29 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

When working with Python projects, it's important to know which versions of packages are installed in your environment. This helps ensure compatibility, manage dependencies, and troubleshoot issues effectively. Whether you're collaborating on a team, deploying an application, or simply maintaining your own codebase, being aware of the installed package versions is essential for a smooth development workflow. Let's understand the different method to do this efficiently.

Using pip show

The pip show command is one of the most straightforward ways to check the installed version of a package. It provides detailed information about the package, including the version number, location and dependencies.

  • Open the terminal or command prompt.
  • Type the following command and press Enter:

pip show package_name

Example: To check the version of emoji package, we would use:

pip show emoji

Output

pip-show-emoji-output
pip show to check python package version

Using import and __version__

If we are already in a Python environment, we can find out the version of a package by importing it and checking its __version__ attribute.

import emoji
print(emoji.__version__)

Output

import-emoji-version
Check Python Package Version

Using Python -c Command

With -c flag we can run python code from the terminal.

python -c "import emoji; print('emoji:', emoji.__version__)"

Output

python-c-emoji-version
Python -c Command

Using pip list

Another way to check the version of an installed package is by using the pip list command. This command lists all installed packages along with their versions.

pip list

Output

Scroll through the list to find the package name and its version number.

pip-list-output
pip list to check python package version

Using pip freeze

The pip freeze command is similar to pip list, but it formats the output in a way that's often used for creating requirements.txt files. It lists all installed packages with their exact versions.

pip freeze

Output

Find the package in the output to see its installed version.

pip-freeze-output
pip freeze to check python package version

To create a requirements.txt file with all installed packages and their versions, use the pip freeze command. The > symbol redirects the output to a file instead of showing it on the screen:

pip freeze > requriements.txt


Next Article
Article Tags :
Practice Tags :

Similar Reads