遇到CondaSSLError: OpenSSL appears to be unavailable on this machine,DEBUG:urllib3.connectionpool如何解决

CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to download and install packages.

(slim) C:\Users\24205>conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): failed

CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to download and install packages.

Exception: HTTPSConnectionPool(host='mirrors.shanghaitech.edu.cn', port=443): Max retries exceeded with url: /anaconda/cloud/pytorch/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

解决方法:在官网https://www.anaconda.com/上重新下载anacondahttps://www.anaconda.com/download/

注意:不要下载和原来版本相同的anaconda,换一个全新的anaconda进行下载

DEBUG:urllib3.connectionpool:Starting new HTTPS conne

(base) PS C:\Users\24205> conda create -n shuwa python=3.9
Collecting package metadata (current_repodata.json): | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
| DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/win-64/current_repodata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/msys2/noarch/current_repodata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/msys2/win-64/current_repodata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/noarch/current_repodata.json HTTP/1.1" 200 None
| DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/win-64/current_repodata.json HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/noarch/current_repodata.json HTTP/1.1" 200 None
done
Solving environment: done

## Package Plan ##

  environment location: D:\LenovoSoftstore\anaconda\envs\shuwa

  added / updated specs:
    - python=3.9


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2023.05.30 |       haa95532_0         120 KB
    openssl-3.0.10             |       h2bbff1b_0         7.4 MB
    pip-23.2.1                 |   py39haa95532_0         2.8 MB
    python-3.9.17              |       h1aa4202_0        19.4 MB
    setuptools-68.0.0          |   py39haa95532_0         925 KB
    sqlite-3.41.2              |       h2bbff1b_0         894 KB
    tzdata-2023c               |       h04d1e81_0         116 KB
    vc-14.2                    |       h21ff451_1           8 KB
    vs2015_runtime-14.27.29016 |       h5e58377_2        1007 KB
    wheel-0.38.4               |   py39haa95532_0          83 KB
    ------------------------------------------------------------
                                           Total:        32.7 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/win-64::ca-certificates-2023.05.30-haa95532_0
  openssl            pkgs/main/win-64::openssl-3.0.10-h2bbff1b_0
  pip                pkgs/main/win-64::pip-23.2.1-py39haa95532_0
  python             pkgs/main/win-64::python-3.9.17-h1aa4202_0
  setuptools         pkgs/main/win-64::setuptools-68.0.0-py39haa95532_0
  sqlite             pkgs/main/win-64::sqlite-3.41.2-h2bbff1b_0
  tzdata             pkgs/main/noarch::tzdata-2023c-h04d1e81_0
  vc                 pkgs/main/win-64::vc-14.2-h21ff451_1
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
  wheel              pkgs/main/win-64::wheel-0.38.4-py39haa95532_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
setuptools-68.0.0    | 925 KB    |                                                                              |   0% DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443                            |   0%
sqlite-3.41.2        | 894 KB    |                                                                              |   0%
tzdata-2023c         | 116 KB    |                                                                              |   0%
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443                           |   0%

                                                                                                                       DEBUG:urllib3.connectionpool:Starting new HTTPS conne

解决方法:命令行中输入conda update conda

注意:命令行中运行conda update conda时,还是会出现DEBUG的一堆错误,这个无关紧要,执行这个命令行过后就不会出现这种错误了

你可能感兴趣的:(环境配置,学习)