deneme.py :
from PyQt5.QtWidgets import QMainWindow,QWidget,QGridLayout,QApplication
import pyqtgraph as pg
import sys
class Deneme(QMainWindow):
def __init__(self):
super().__init__()
self.setGeometry(100, 100, 600, 500)
self.dene()
def dene(self):
widget = QWidget()
plot = pg.plot()
x=[1,2,3,4,5,6,7]
y=[1,2,4,5,6,8,7,12,6]
bargraph = pg.BarGraphItem(x = x, height = y, width = 0.6, brush ='b')
plot.addItem(bargraph)
layout = QGridLayout()
widget.setLayout(layout)
layout.addWidget(plot)
self.setCentralWidget(widget)
uyg = QApplication(sys.argv)
de = Deneme()
de.show()
uyg.exec_()
“deneme.py” dosyasını Anaconda Prompt’ta çalıştırdığımda hata almıyorum ve fotoğraftaki çıktıyı alabiliyorum :
Fakat bu dosyayı exe’ye dönüştürdüğümde cmd’de “ModuleNotFoundError” alıyorum.
pip install pyqtgraph
ile modulü yüklememe rağmen bu hatayı almamın sebebi ne olabilir? Ve nasıl çözebilirim?
Hatanın tamamı :
Traceback (most recent call last):
File "deneme.py", line 2, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "pyqtgraph\__init__.py", line 203, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "pyqtgraph\graphicsItems\GraphicsLayout.py", line 5, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "pyqtgraph\graphicsItems\ViewBox\__init__.py", line 1, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "pyqtgraph\graphicsItems\ViewBox\ViewBox.py", line 1714, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 540, in exec_module
File "pyqtgraph\graphicsItems\ViewBox\ViewBoxMenu.py", line 8, in <module>
File "importlib\__init__.py", line 127, in import_module
ModuleNotFoundError: No module named 'pyqtgraph.graphicsItems.ViewBox.axisCtrlTemplate_pyqt5'
[13092] Failed to execute script deneme