简体   繁体   English

错误:找不到满足 webdriver 要求的版本(来自版本:)

[英]Error : Could not find a version that satisfies the requirement webdriver (from versions: )

hi i new developer at python i want to use selenium web driver api and use mac pc and i installation web driver library嗨,我是 Python 的新开发人员,我想使用 selenium Web 驱动程序 API 并使用 mac pc 并且我安装 Web 驱动程序库

i installation code 'pip install web driver' at pycharm project interpreter but error我在 pycharm 项目解释器上安装代码“pip install web driver”但错误

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 :(注意:我使用 python 3.5 但终端使用 2.7 :(

No matching distribution found for web driver找不到与 Web 驱动程序匹配的发行版

Could your help me please你能帮我吗

Best wishes...最好的祝愿...

This is not very clearly documented, but you cannot install webdriver from pypi but need to install selenium, which then gives you webdriver.这不是很清楚地记录在案,但是您不能从 pypi 安装 webdriver,但需要安装 selenium,然后它会为您提供 webdriver。

sudo pip install selenium

should do the trick.应该做的伎俩。 Or for modern python:或者对于现代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.您还需要安装 geckodriver(适用于 Firefox)或 chromedriver(适用于 Chrome 和 Chromium)并将其放在您的路径中,以便能够实例化 webdriver 对象。

After that things like the below should work:之后,像下面这样的事情应该可以工作:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://stackoverflow.com/questions/34256762/error-could-not-find-a-version-that-satisfies-the-requirement-webdriver-from")

you may try the following way, if you do not know the path, use !apt install chromium-chromedriver您可以尝试以下方式,如果您不知道路径,请使用 !apt installchromium-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)
sudo python3 -m pip install selenium 

Still threw an error:还是报错:

Collecting selenium Could not find a version that satisfies the requirement selenium (from versions: ) No matching distribution found for selenium收集硒找不到满足硒要求的版本(来自版本:)找不到硒的匹配发行版

I have Python2.7 and 3.5 installed我安装了 Python2.7 和 3.5

I encountered a similar problem on Ubuntu.我在 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.我想安装特定的 Selenium 版本,但我不确定确切的标签,因为 Dockerhub 上的标签略有不同。 So my steps were:所以我的步骤是:

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

2 Click Release history tab 2 单击Release history选项卡在此处输入图片说明

3 Find a specific version I needed. 3 找到我需要的特定版本。 In my case it was 4.0.0.a7就我而言,它是 4.0.0.a7

4 From Linux Terminal execute: 4 从 Linux 终端执行:

pip install selenium==4.0.0.a7

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:找不到满足要求 webdriver 的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement webdriver (from versions: none) 错误:找不到满足 pyautogui 要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement pyautogui (from versions: none) 错误:找不到满足 tensorflow 要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) 错误:找不到满足要求时间的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement time (from versions: none) 错误:找不到满足Deepcorrect要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement deepcorrect (from versions: none) 错误:找不到满足火炬要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement torch (from versions: none) 错误:找不到满足 csv 要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement csv (from versions: none) 错误:找不到满足 busio 要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement busio (from versions: none) 错误:找不到满足 fastapi 要求的版本(来自版本:无) - ERROR: Could not find a version that satisfies the requirement fastapi (from versions: none) 找不到满足 optapy 要求的版本(来自版本:无) - Could not find a version that satisfies the requirement optapy (from versions: none)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM