Automatically fetch the installed version

from pkg_resources import get_distribution, DistributionNotFound

try:
    version = get_distribution("foo").version
except DistributionNotFound:
    version = "unknown"

Recommended Posts

Automatically fetch the installed version
Macports easy_install automatically resolves and runs the version
Get the GNOME version
Align the version of chromedriver_binary
[Python] Check the installed libraries
The first artificial intelligence. How to check the version of Tensorflow installed.
Test the version of the argparse module
Raise the version of pyenv itself
I installed the IoT platform "Rimotte"
pyenv-change the python version of virtualenv
How to get the Python version
Change the Python version of Homebrew
Determine if the library is installed.
Try using n to downgrade the version of Node.js you have installed