安装

Speedtest CLI:适用于命令行的互联网速度测试

timeout报错(我用了python3运行的)

#python3 speedtest.py
Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: <urlopen error timed out>

改为

python speedtest.py

就能正常运行了

ssl验证报错

Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)>

在 speedtest.py 文件第一行加上

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

还有可能是dns找不到服务器IP报错

ping speedtest.net

如果能ping通,就不是dns报错

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐