Error : Could not find a version that satisfies the requirement webdriver (from versions: )
Asked Answered
B

4

9

hi i new developer at python i want to use selenium web driver api and use mac pc and i installation web driver library

i installation code 'pip install web driver' at pycharm project interpreter but error

Error definition look this:

  Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/bin/python3.5'.




  Could not find a version that satisfies the requirement webdriver (from versions: )
No matching distribution found for web driver

Note: i use python 3.5 but terminal use 2.7 :(

No matching distribution found for web driver

Could your help me please

Best wishes...

Beitch answered 13/12, 2015 at 21:47 Comment(1)
I am really confused. What are you trying to do exactly? To install selenium you need to install, well, selenium. Not webdriver. So it should be pip install seleniumWhirl
J
10

This is not very clearly documented, but you cannot install webdriver from pypi but need to install selenium, which then gives you webdriver.

sudo pip install selenium

should do the trick. Or for modern python:

sudo python3 -m pip install selenium

You also need to install geckodriver (for Firefox) or chromedriver (for Chrome and Chromium) and have it in your path, to be able to instanciate a webdriver object.

After that things like the below should work:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://mcmap.net/q/1191639/-error-could-not-find-a-version-that-satisfies-the-requirement-webdriver-from-versions")
Jardiniere answered 28/12, 2015 at 18:4 Comment(2)
i am try but thrown error Traceback (most recent call last): driver = webdriver.Firefox() File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in init self.binary, timeout),Beitch
I can reproduce this error message on a system without Firefox installed. After the installation of Firefox the error is gone and I get the expected Firefox window.Jardiniere
C
1

I encountered a similar problem on Ubuntu. I wanted to install a specific Selenium version, but I was not sure about the exact tag, as tag on Dockerhub differs a bit. So my steps were:

1 Go to https://pypi.org/project/selenium/#files

2 Click Release history tab enter image description here

3 Find a specific version I needed. In my case it was 4.0.0.a7

4 From Linux Terminal execute:

pip install selenium==4.0.0.a7
Chari answered 7/1, 2022 at 0:10 Comment(0)
W
0

you may try the following way, if you do not know the path, use !apt install chromium-chromedriver

!pip install selenium
!pip install webdriver-manager
!apt-get update # to update ubuntu to correctly run apt install
!apt install chromium-chromedriver

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import requests

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
wd = webdriver.Chrome('chromedriver',chrome_options=chrome_options)
driver =webdriver.Chrome('chromedriver',chrome_options=chrome_options)
Washerman answered 13/5, 2020 at 21:57 Comment(0)
P
0

This worked for me

sudo python3 -m pip install selenium

And after installing selenium, you can install the web driver manager

sudo python3 -m pip install webdriver_manager
Plovdiv answered 9/3, 2022 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.