Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

How do I check the versions of Python modules?

I installed the Python modules construct and statlib using setuptools:

sudo apt-get install python-setuptools

sudo easy_install statlib
sudo easy_install construct

How do I check their versions from the command line?

Answer*

Cancel
3
  • 5
    This just avoids attempting to print __version__ if it not defined. If there is no __version__, you receive no result for the package you want. Commented Jul 28, 2016 at 10:25
  • If the module does no have a __version__ attribute, which is the standard (python.org/dev/peps/pep-0396/#specification), it is impossible to know where and how the version is included without manual investigation. Commented Feb 11, 2017 at 15:41
  • An explanation would be in order. E.g., what is the idea/gist? From the Help Center: "...always explain why the solution you're presenting is appropriate and how it works". Please respond by editing (changing) your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today). Commented Apr 7, 2022 at 22:44