Could not fetch URL https://pypi.org/simple/torchsummary/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/torchsummary/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skippingERROR: Could not find a version that satisfies the requirement torchsummary (from versions: none) ERROR: No matching distribution found for torchsummary 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

碰到这个问题,主要原因是网站pypi.python.org在国内是别墙了,在安装程序时,无法从python官网下载资料导致的。

下面解决方法适合windows系统

1.在C盘,进入%user%pip目录,就是在当前的用户找到pip文件夹,在里面创建pip.ini

文件,文件内容如下

[global]

index-url=http://pypi.douban.com/simple/

[install]

trusted-host=pypi.douban.com

 2.保存,重新使用pip install xx即可

方法2:安装最新的openssl

打开网址:[ Downloads ] - /source/index.html

下载安装包:https://www.openssl.org/source/openssl-1.1.1d.tar.gz

编译安装:

tar -zxvf openssl-1.1.1d.tar.gz

cd openssl-1.1.1d

./config --prefix=/usr/local/openssl/

make && make install && make clean

mv /usr/bin/openssl /usr/bin/openssl.bak

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1

ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

方法三:

首先运行下面的代码:

pip config set global.extra-index-url http://mirrors.aliyun.com/pypi/simple

2. 找到上面路径下的文件,使用以下内容覆盖原本pip.ini中的内容

[global]

index-url = https://mirrors.aliyun.com/pypi/simple

extra-index-url = https://mirrors.aliyun.com/pypi/simple

[install]

trusted-host =

mirrors.aliyun.com

pypi.douban.com

pypi.tuna.tsinghua.edu.cn

pypi.mirrors.ustc.edu.cn

mirrors.ustc.edu.cn

mirrors.bfsu.edu.cn

pypi.hustunique.com

 

文章链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: