I keep struggling with importing the pyqtgraph module. It's really only about the import: pip3 install pyqtgraph
is not working. My code: from PyQt5 import QtGui
import PyQt5
import numpy as np
from PyQt5.QtWidgets import QMainWindow, QApplication, QMessageBox
import pyqtgraph as pg
import time
leaves:
<ipython-input-37-14dc06d126e4> in <module>
31 import numpy as np
32 from PyQt5.QtWidgets import QMainWindow, QApplication, QMessageBox
---> 33 import pyqtgraph as pg
34 import time
35 import sys
ModuleNotFoundError: No module named 'pyqtgraph'
I am guessing that your module gets installed to another Python
version than what PYTHONPATH
points to.
Try pip3 list -v | grep "pyqtgraph"
pip3 list -v | grep "pyqtgraph"
on Unix-like OSs
, or pip3 list -v | findstr "pyqtgraph"
pip3 list -v | findstr "pyqtgraph"
on Windows
.
The directory location that will be shown will be different to your PYTHONPATH
. Set your location to PYTHON3.7
dir and it should solve your problem. See here on how you can do that.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.