【问题标题】:Installing keras in R: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available在 R 中安装 keras:警告:pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用
【发布时间】:2021-11-19 00:04:32
【问题描述】:

我是 keras 的新手,我试图在运行 Windows 10 的计算机上使用 this 指南在 R 中安装 keras 和 tensorflow,但得到标题中的错误:

install_keras()

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

All requested packages already installed.

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
Could not fetch URL https://pypi.org/simple/tensorflow/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tensorflow/ (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 tensorflow==2.6.* (from versions: none)
ERROR: No matching distribution found for tensorflow==2.6.*
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 retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Error: Error installing package(s): "\"tensorflow==2.6.*\"", "\"tensorflow-hub\"", "\"scipy\"", "\"requests\"", "\"Pillow\"", "\"h5py\"", "\"pandas\""

由于this 的问题,我尝试安装 OpenSSL,还尝试按照here 的描述复制 dll,但没有任何效果。

有什么建议吗?

【问题讨论】:

    标签: r tensorflow ssl keras


    【解决方案1】:

    所以,我自己找到了解决方案。我做到了:

    library(reticulate)
    install_miniconda(force = TRUE)
    

    在 Windows 的命令提示符下,我做到了:

    conda activate r-reticulate
    install keras
    

    ...一切正常!

    即使我没有激活 r-reticulate 环境,现在似乎也可以工作。

    【讨论】:

      猜你喜欢
      • 2021-07-27
      • 2021-11-04
      • 2020-10-30
      • 2023-01-20
      • 2021-07-28
      • 2019-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多