M-J-Murray / MAMEToolkit

A Python toolkit used to train reinforcement learning algorithms against arcade games
GNU General Public License v2.0
639 stars 114 forks source link

Qt platform plugin "xcb" not found --- calling run_cheat_debugger() #30

Open ghost opened 2 years ago

ghost commented 2 years ago

I can get Joust running with the emulator. I have to press F10 at the start to fix a speed issue. I can't use the cheat debugger, apparently, as that's what's different.

Based on reading about this type of error, the solution is usually hard to find, and has nothing to do with the Qt installation or path variables.

joust2.py

from MAMEToolkit.emulator import run_cheat_debugger

roms_path = "/home/pc2/Desktop/MAME_Test/"  # Replace this with the path to your ROMs
game_id = "joust"

run_cheat_debugger(roms_path, game_id)

Running it:

pc2@PC:~/Desktop/MAME_Test$ python3 joust2.py
Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
QFactoryLoader::QFactoryLoader() checking directory path "/home/pc2/.local/lib/python3.9/site-packages/MAMEToolkit/emulator/mame/platforms" ...
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
b'\x1b[1;36m[MAME]\x1b[0m> '
pc2@PC:~/Desktop/MAME_Test$ 

Python 3.9.5 Ubuntu 21.04

ghost commented 2 years ago

I also tried installing Ubuntu 20.04.2 LTS, using the included Python 3.8.10 Qt installed with sudo apt-get install qt5-default After I got the errors, I tried the commonly suggest Ubuntu fix: sudo apt-get install --reinstall libxcb-xinerama0No change.

Here are the new errors after setting a Qt path variable, and a Qt debugging variable (with just the Qt debugging variable, the results are identical to what I first posted).

pc2@pc:~/Desktop/MAME_Test$ export QT_QPA_PLATFORM_PLUGIN_PATH="/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms"
pc2@pc:~/Desktop/MAME_Test$ export QT_DEBUG_PLUGINS=1

pc2@pc:~/Desktop/MAME_Test$ python3 joust22.py

Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
"Plugin verification data mismatch in '/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so'" 
         not a plugin

 **(many repeats of this error for different .so files at this directory location)**  
 **(including libqxcb.so)**

QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/pc2/.local/lib/python3.8/site-packages/MAMEToolkit/emulator/mame/platforms" ...
This application failed to start because it could not find or load the Qt platform plugin "xcb" 
in "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms".

Reinstalling the application may fix this problem.
b'\x1b[1;36m[MAME]\x1b[0m> '
pc2@pc:~/Desktop/MAME_Test$ 
ghost commented 2 years ago

Building the modified MAME on your system following the toolkit author's instructions solves this problem.

sl92983 commented 1 year ago

I got the same error. Could you share how to fix it? Thanks!