When I install Selenium I get the following error:
Shubham@Shubham-To-be-filled-by-O-E-M:~$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 https://repo.skype.com/deb stable InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 323 kB in 8s (38.6 kB/s)
Reading package lists... Done
Shubham@Shubham-To-be-filled-by-O-E-M:~$ sudo pip install selenium
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
How should I proceed?
Selenium is available from the default Ubuntu repositories in Ubuntu 16.04 and later. To install selenium open the terminal and type:
and/or
Then type
python
to start the Python interpreter andfrom selenium import webdriver
should work like this:Assuming that the path
~/.local/bin
is in your execution PATH, here's how to install the Firefox webdriver, called geckodriver:To install a specific version go to pypi.
Find a version you need from the Release history and on the example of tag
4.0.0.a7
run:The same works for
Ubuntu 20.04
.