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
I had the same issue. I was using PyCharm IDE.
The issue occurs when you install speedtest using pip install speedtest
In order to solve the above mentioned issue, you need to use the following command.
pip install speedtest-cli
But before doing this, uninstall the previous one by using pip uninstall speedtest
Screenshot to installation
I was getting the same error. Then I google the problem and eventually came here. Later I realised that I have named my python file speedtest.py. I renamed it to something else (which is not the name of any python module) and it works just fine now.
<--Screenshot-->
So make sure this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With