python - python 'speedtest' 没有属性 'Speedtest'
问题描述
我试图通过使用“speedtest”模块在python中获得下载和上传速度,但是当我使用该模块时它给了我这个错误:
AttributeError:模块“speedtest”没有属性“Speedtest”。
我只是在声明变量,即我的代码:
import speedtest
speedtester = speedtest.Speedtest()
由于某种原因,该模块实际上没有这些功能。请告诉我我的代码有什么问题我确定从 cmd 和 pycharm 终端导入模块,但仍然遇到相同的错误。提前致谢
解决方案
我遇到过同样的问题。我正在使用 PyCharm IDE。使用安装speedtest时出现问题pip install speedtest
为了解决上述问题,您需要使用以下命令。
pip install speedtest-cli
但在此之前,请使用pip uninstall speedtest
屏幕截图卸载前一个安装
推荐阅读
- python - 如何暂停或删除manim中的声音?
- javascript - Java 脚本正则表达式接受多个值,包括 Mountebank 谓词中的空值
- c++ - 在 for 循环中声明变量是否有替代方法?
- c# - 如何连接到 AWS EC2 实例 wwwroot 文件夹?
- r - 在 R 的原始数据框中按组创建新列
- reactjs - 如何在 ReactJS 中使表单输入相互依赖
- ios - 如何快速解析以下 JSON?它有成功:标志
- android - 如果空间不足,Android 在布局组件时会做什么?
- php - 将多个数组加入单个 foreach
- vue.js - VueJS $set 没有在对象数组中创建新属性