I have Termux app installed on my Android phone. Is there a speed test tool that I can install and use from the command line? I have tried speedtest-cli, installed it by:

pip install speedtest-cli
pip install speedtest-cli --upgrade

I also have python installed.

When trying to use speedtest-cli it gives me error:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/speedtest.py", line 1401, in shell
    speedtest = Speedtest()
  File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/speedtest.py", line 743, in _init_
  File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/speedtest.py", line 765, in get_config
    raise ConfigRetrievalError(e)
speedtest.ConfigRetrievalError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/speedtest-cli", line 11, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/speedtest.py", line 1498, in main
  File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/speedtest.py", line 1402, in shell
    except (ConfigRetrievalError, HTTP_ERRORS):
TypeError: catching classes that do not inherit from BaseException is not allowed

How do I get a working command-line speedtest tool in Android and Termux?

1 Answer 1


We can run an script called speedtest.py localized in Github

python speedtest.py

  • I'm trying to place that script inside the python working directory /data/data/com.termux/files/usr/bin/python but it turns out I can't access it unless I root my phone (Nougat). Is there a way to set an external python path outside the termux directory?
    – FartVader
    Jan 1, 2018 at 2:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .