I’m trying with my code "import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog
from avogadro import *
class AvogadroWindow(QMainWindow):
def init(self):
super().init()
self.setWindowTitle(“Avogadro Platform”)
# Crear instancia de Avogadro
self.avogadro = Avogadro()
# Configurar herramientas y funciones
self.avogadro.loadDrawingTools()
self.avogadro.loadNavigationTools()
self.avogadro.loadManipulationTools()
self.avogadro.loadSelectionTools()
self.avogadro.loadAutoRotateTool()
self.avogadro.loadClickMeasureTool()
self.avogadro.loadDeleteTool()
self.avogadro.loadDisplayTypes()
# Agregar widget de Avogadro a la ventana principal
self.setCentralWidget(self.avogadro.widget())
# Configurar acciones de menú
open_action = self.avogadro.action("file/open")
open_action.triggered.connect(self.open_file)
save_action = self.avogadro.action("file/save")
save_action.triggered.connect(self.save_file)
def open_file(self):
file_name, _ = QFileDialog.getOpenFileName(self, "Open File", "", "Molecular Files (*.mol *.mol2 *.sdf *.xyz)")
if file_name:
self.avogadro.loadFile(file_name)
def save_file(self):
file_name, _ = QFileDialog.getSaveFileName(self, "Save File", "", "Molecular Files (*.mol *.mol2 *.sdf *.xyz)")
if file_name:
self.avogadro.saveFile(file_name)
if name == “main”:
app = QApplication(sys.argv)
window = AvogadroWindow()
window.show()
sys.exit(app.exec_())
" but when I install Avogadro’s plugins, I have issues with Qt. the following error "qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
" I thought uninstalling Qt and reinstalling it would fix it, but it didn’t. Any suggestions or ideas?