A.R.
A.R.

Reputation: 2068

How do I retrieve the version of Selenium currently installed, from Python?

How can I programmatically get the version of Selenium I have installed in my Python environment?

Upvotes: 33

Views: 124419

Answers (6)

YU SHUN LIM
YU SHUN LIM

Reputation: 11

There are 2 methods to retrieve it

  1. Using the command line in command prompt
pip show selenium
  1. Run a python file
import selenium

print("Selenium version:", selenium.__version__)

Upvotes: 1

Andromodos
Andromodos

Reputation: 1

Download pip to Anaconda and then pip install selenium through the Anaconda prompt.

Upvotes: -1

Mucheru
Mucheru

Reputation: 343

Try using pip show selenium. That worked for me.

Upvotes: 23

ZF007
ZF007

Reputation: 3731

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.

Upvotes: 7

Abhishek
Abhishek

Reputation: 41

Please use the 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.

Upvotes: 4

alko
alko

Reputation: 48357

As simply as

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

or for command line:

$ python -c "import selenium; print(selenium.__version__)"
2.37.2

Upvotes: 61

Related Questions