October 22, 2024
Chicago 12, Melborne City, USA
python

This error occurs after packaging the vispy program with pyintsaller


import sys
import numpy as np
from PyQt5 import QtWidgets
from vispy import  scene
from vispy.app import use_app

use_app('PyQt5') 
N = 500
class MainWindow(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        self.canvas = scene.SceneCanvas(keys="interactive", show=True)
        self.canvas.unfreeze()  
        self.canvas.create_native()
        self.canvas.native.setParent(self)
        self.main_widget = QtWidgets.QWidget(self)
        self.setCentralWidget(self.main_widget)
        layout = QtWidgets.QVBoxLayout(self.main_widget)
        layout.addWidget(self.canvas.native)
        button_layout = QtWidgets.QHBoxLayout()
        layout.addLayout(button_layout)
 
        grid = self.canvas.central_widget.add_grid(margin=10)
        self.xaxis = scene.AxisWidget(orientation='bottom')
        self.xaxis.height_max = 80
        grid.add_widget(self.xaxis, row=1, col=1)
if __name__ == '__main__':
    appQt = QtWidgets.QApplication(sys.argv)
    win = MainWindow()
    win.show()
    appQt.exec_()

enter image description here

It works with .py file,but when I use Pyinstaller released app ***I get this error.***Prompt I can not open resources, is it because the path has changed after the vispy packaging



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video