AttributeError: 模块“speedtest”没有属性“Speedtest”

问题描述

正如标题所说,我在尝试运行这个简单的 Python 代码时遇到了这个错误:

import speedtest

r = speedtest.Speedtest()

结果

Traceback (most recent call last):
File "c:/Users/XXXX/YYYYYY/VSCode/Poli.py",line 3,in <module>
r = speedtest.Speedtest()
AttributeError: module 'speedtest' has no attribute 'Speedtest'

我已经浏览了在 SE 和网络上可以找到的所有帖子: getting an AttributeError: module 'speedtest' has no attribute 'Speedtest' python 'speedtest' has no attribute 'Speedtest' speedtest module in python speedtest-cli works in console,but not as script https://cloudstack.ninja/pratik-amonkar/how-can-i-fixed-error-of-speedtest-module/

我只能确定在我的项目文件夹中某个地方存在一个 speedtest.py,它把事情搞砸了,但我找不到这个特定的文件。我已经多次重新安装该软件包,更改了文件名并尝试了其他虚拟环境。我怎样才能避免这个错误?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)