- liuxu2018-12-02金牌会员120646
虽然是我写的,但是懒得清除markdown标签再整理一遍了,直接从隔壁转载:https://www.v2ex.com/t/513463
由于hostloc很多人不会改代码,所以直接用我的就好了:
liuxu:speedtest$ wget -O speedtest-cli https://raw.githubusercontent.com/liuquanhao/speedtest-cli/master/speedtest.py
liuxu:speedtest$ chmod +x speedtest-cli如果在ubuntu中用apt安装的speedtest,可以直接执行源文件:
liuxu:~$ python2 /usr/lib/python2.7/dist-packages/speedtest_cli.py
出问题的主要原因是python3更新urllib.request后,speedtest没及时更新。如果python3版本在 v3.6.0b1 以上,上传测试就会出问题。