Reputation: 2068
How can I programmatically get the version of Selenium I have installed in my Python environment?
Upvotes: 33
Views: 124419
Reputation: 11
There are 2 methods to retrieve it
pip show selenium
import selenium
print("Selenium version:", selenium.__version__)
Upvotes: 1
Reputation: 1
Download pip to Anaconda and then pip install selenium through the Anaconda prompt.
Upvotes: -1
Reputation: 3731
You can try:
pip list
conda list
Or for example on Mac:
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
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
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