Reputation: 55
I am not getting any executable to work by using Pyinstaller, Pyside2 and Matplotlib(PyQtGraph).
I tried different Python versions (3.5, 3.6, 3.7) latest release and development version of Pyinstaller, latest Pyside2 and latest Matplotlib versions. The latest "success" I've had is to create an exe file (dir or onefile doesn't change the result) for Matplotlib(3.0.2) or PyQtGraph(development 0.11) on python 3.5, pyside2 (5.12.0), but when I try to start the following error occurs:
ImportError: No module named 'numpy.core._dtype_ctypes' [11856] Failed to execute script Pyside2PyQTGraph
When I only do a Pyside2 only example with a label only, everything works as expected. I also tried --hidden-imports numpy but it didn't help. I can share the source code of course. In addition I'd prefer to use Matplotlib but PyQtGraph is fine as well.
What else is left for me to try? What am I doing wrong? By the way I am using Windows 10.
from PySide2.QtWidgets import QWidget, QApplication,QVBoxLayout
import sys
from matplotlib.backends.backend_qt5agg import FigureCanvas as Canvas
from matplotlib.figure import Figure
from matplotlib import rcParams
class MatplotlibWidget(QWidget):
def __init__(self):
QWidget.__init__(self)
self.canvas = Canvas(Figure())
vertLayout = QVBoxLayout()
vertLayout.addWidget(self.canvas)
self.setLayout(vertLayout)
self.axes = self.canvas.figure.add_subplot(111)
if __name__ == "__main__":
qapp = QApplication(sys.argv)
app = MatplotlibWidget()
app.axes.plot(range(12), range(12))
app.show()
qapp.exec_()
Upvotes: 0
Views: 972
Reputation: 652
There seems to be a problem with the current numpy release (1.16.0). Downgrading numpy via
python -m pip install numpy==1.15.0
solved it for me.
Upvotes: 1