【问题标题】:Issue while installing selenium安装硒时出现问题
【发布时间】:2020-04-03 11:04:49
【问题描述】:

我的系统配置是:

操作系统:Windows10 Python 随 Anaconda 一起安装。

当我尝试使用命令pip install selenium 使用 pip 安装“Selenium”时。它给出了以下错误:

D:\>pip install selenium
WARNING: pip is configured with locations that require TLS/SSL, however the ssl
module in Python is not available.

Collecting selenium



    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, stat
    us=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/

    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, stat
    us=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, stat
    us=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL becau
    se the SSL module is not available.")': /simple/selenium/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, stat
    us=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL becau
    se the SSL module is not available.")': /simple/selenium/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, stat
    us=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL becau
    se the SSL module is not available.")': /simple/selenium/
      Could not fetch URL https://pypi.org/simple/selenium/: There was a problem con
    firming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
     retries exceeded with url: /simple/selenium/ (Caused by SSLError("Can't connect
     to HTTPS URL because the SSL module is not available.")) - skipping
      ERROR: Could not find a version that satisfies the requirement selenium (from
    versions: none)
    ERROR: No matching distribution found for selenium
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl
    module in Python is not available.

    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming
    the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retrie
    s exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS UR
    L because the SSL module is not available.")) - skipping

【问题讨论】:

  • 您是在激活环境的 anaconda 命令提示符下运行它吗?

标签: python selenium pip


【解决方案1】:

您可以从Anaconda Prompt 尝试。

你会看到 (base),现在升级 pip。 示例:

Python 代码:

(base) C:\Users\Tom>cd ..
(base) C:\Users>cd ..
(base) C:\>python -m pip install --upgrade pip
Requirement already up-to-date: pip in g:\anaconda3\lib\site-packages (20.0.2)
(base) C:\>pip -V
pip 20.0.2 from G:\Anaconda3\lib\site-packages\pip (python 3.7)
# Try install
(base) C:\>pip install selenium

这需要更长的时间,但也会安装或升级 Anaconda 内部使用的 SSL 库。

Python 代码:

(base) C:\>conda update condo
......
pyopenssl-19.1.0     | 47 KB     | #################################### | 100%
openssl-1.1.1f       | 4.7 MB    | #################################### | 100%

Source

【讨论】:

    猜你喜欢
    • 2021-04-05
    • 1970-01-01
    • 2017-02-24
    • 1970-01-01
    • 2012-03-22
    • 2021-01-14
    • 2019-01-14
    • 2011-03-29
    • 2017-01-08
    相关资源
    最近更新 更多