安装指令
pip install torchsummary
报错
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x000001AC15B5A820>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /pypi/web/simple/torchsummary/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x000001AC15B5AB50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /pypi/web/simple/torchsummary/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x000001AC15B5AD00>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /pypi/web/simple/torchsummary/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x000001AC15B5AEE0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /pypi/web/simple/torchsummary/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x000001AC15B5AFA0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /pypi/web/simple/torchsummary/
ERROR: Could not find a version that satisfies the requirement torchsummary (from versions: none)
ERROR: No matching distribution found for torchsummary
初步分析,是网络原因。
解决办法
加镜像源
pip install torchsummary -i http://mirrors.aliyun.com/pypi/simple/
又报错
WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instea
d, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement torchsummary (from versions: none)
ERROR: No matching distribution found for torchsummary
解决办法,成功!
再加个信任镜像源
pip install torchsummary -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
常用镜像源汇总
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学:https://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
网易云:https://mirrors.163.com/pypi/simple/
百度云:https://mirror.baidu.com/pypi/simple/
华为云:https://mirrors.huaweicloud.com/repository/pypi/simple/
腾讯云:https://mirrors.cloud.tencent.com/pypi/simple/
搜狐:http://mirrors.sohu.com/Python/