pythonspeed-test

python 'speedtest' has no attribute 'Speedtest'


I am trying to get the download and upload speed in python by using the "speedtest" module, but it gives me that error when I use the module:

AttributeError: module 'speedtest' has no attribute 'Speedtest'.

and I was only declaring the variable, that is my code :

import speedtest

speedtester = speedtest.Speedtest()

The module actually doesn't have the functions for some reason. Please tell me what is wrong with my code I was sure to import the module from the cmd and also the pycharm terminal and still got the same error. Thanks in advance


Solution

  • The issue got solved after moving the speedtest.py file to the same directory as my script and it worked just fine. So just make sure the file is in the same folder as your python script.