安装了pyqtgraph,但是当我导入它时,请识别出来

发布于 2025-01-21 13:31:46 字数 607 浏览 3 评论 0 原文

我正在尝试运行此代码,该代码可视化音频波形及其傅立叶变换

它需要Numpy,Pyqt和Pyqtgraph。当我运行它时,我会发现蝙蝠的错误。

from pyqtgraph.Qt import QtGui, QtCore
ModuleNotFoundError: No module named 'pyqtgraph'

我知道我已经安装了此功能,因为我的站点包装夹中有pyqtgraph。我使用PIP安装pyqtgraph将其安装,如果我再次运行命令,它将确认已经执行了安装。

我在做什么错?有一些版本不兼容吗?我需要在我的PJ上做一点舞蹈才能使它起作用吗?我不知道。

I am trying to run this code that visualizes audio waveforms and their fourier transforms
https://github.com/markjay4k/Audio-Spectrum-Analyzer-in-Python/commit/ff9caf4156b7a8c039d8beba987f93566a6aace0

It requires numpy, PyQt, and pyqtgraph. When I run it, I get an error right of the bat.

from pyqtgraph.Qt import QtGui, QtCore
ModuleNotFoundError: No module named 'pyqtgraph'

I know I installed this, because I have pyqtgraph in my site-packages folder. I used pip install pyqtgraph to install it, and if I run the command again, it confirms that the install has already been performed.

What am I doing wrong? Is there some version incompatability? Do I need to do a little dance in my PJs to get it working? I'm not sure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛夏尉蓝 2025-01-28 13:31:46

通常,当您尝试在不同的Python版本,虚拟环境或平台中使用库时,这种情况通常会发生。我会按以下方式进行故障排除:

  • 检查错别字,并且您正在使用正确的方式导入库和子模块。
  • 如果您有多个 python 版本,请确保您正在安装库的版本上运行。
  • 如果同时使用 pip conda ,请确保在正确的平台上运行代码。
  • 如果 Python 版本和平台都可以,请检查您在安装了相关库的同一虚拟环境中工作。我认为这是最可能的原因。

您可以找到有关如何检查上述所有内容的大量教程。如果无效,您可以尝试卸载和重新安装。

This normally happens when you try to use a library in either a different Python version, virtual environment, or platform. I'd troubleshoot as follows:

  • Check for typos and that you are using the correct way to import the library and submodules.
  • If you have multiple Python versions, make sure you are running on the one where the library is installed.
  • If you use both pip and conda, make sure you are running the code on the correct platform.
  • If both the Python version and platform are ok, check you are working in the same virtual environment where you installed the library in question. I think this is the most probable cause.

You can find plenty of tutorials on how to check all the above. If nothing works, you can try uninstalling and reinstalling.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文