23

The title says it all, I want to programmatically get the version of Selenium I have installed on my Python environment.

A.R.
  • 1,888
  • 2
  • 14
  • 22

5 Answers5

50

As simply as

>>> import selenium
>>> selenium.__version__
'2.37.2'

or for command line:

$ python -c "import selenium; print(selenium.__version__)"
2.37.2
alko
  • 46,136
  • 12
  • 94
  • 102
  • 2
    Thanks! For some reason I couldn't craft a Google query that would unearth the answer. – A.R. Dec 06 '13 at 16:33
  • 1
    @nemesys That was an easy too, https://www.google.com/search?q=python+module+version :) – alko Dec 06 '13 at 16:35
7

You can try:

  1. pip list

  2. conda list

or for example on MAC:

  1. brew list

And then check if and what version is in your installed package list.

For conda you might have different environments. Change it by conda activate myenv where myenv is the name of your second or more test environments.

ZF007
  • 3,708
  • 8
  • 29
  • 48
7

Try using pip show selenium, that worked for me

Mucheru
  • 83
  • 2
  • 4
4

Please Use below command to see the version of the libraries that would have been installed using pip

pip freeze

It will list all the used libraries with their versions.

Abhishek
  • 41
  • 4
  • What `pip freeze` is and where for used is explained [here](https://stackoverflow.com/a/49251593/8928024) at another SO question. – ZF007 Dec 30 '19 at 09:59
0

download pip to anaconda then pip install selenium through anaconda prompt

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Akzy Mar 13 '23 at 12:48