lukasmonk / lucaschessR2

Lucas Chess R Version 2
GNU General Public License v3.0
267 stars 40 forks source link

Error when running LucasR.py on WSL 2 #114

Closed CheckDaniels closed 12 months ago

CheckDaniels commented 1 year ago

I am currently working in Ubunut 22.04.3 LTS with WSL (in Windows 11). I followed the instructions "https://lucaschess.blogspot.com/2021/07/linux-tutorial-for-creating-installer.html", but when I tried to run the LucasR.py file, I got the following output.

check@LAPTOP-LU8L3B35:~/lucaschessR2-main/bin$ python3 LucasR.py
Traceback (most recent call last):
  File "LucasR.py", line 16, in <module>
    import Code.Base.Init
  File "/home/check/lucaschessR2-main/bin/Code/Base/Init.py", line 5, in <module>
    from Code import Procesador
  File "/home/check/lucaschessR2-main/bin/Code/Procesador.py", line 8, in <module>
    from Code import Adjournments
  File "/home/check/lucaschessR2-main/bin/Code/Adjournments.py", line 4, in <module>
    from Code.QT import QTUtil2
  File "/home/check/lucaschessR2-main/bin/Code/QT/QTUtil2.py", line 1, in <module>
    from PySide2 import QtCore, QtWidgets, QtGui
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I even tried installing libxcb-xinerama0 as described in the instructions. It still didn't change much.

check@LAPTOP-LU8L3B35:~$ sudo apt-get install libxcb-xinerama0
[sudo] password for check:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxcb-xinerama0 is already the newest version (1.14-3ubuntu3).
The following packages were automatically installed and are no longer required:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python-pkg-resources python-setuptools python2 python2-minimal python2.7 python2.7-minimal
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I'm using:

lukasmonk commented 1 year ago

Perhaps: apt-get update && apt-get install libgl1

CheckDaniels commented 1 year ago

Thanks I think it helped a little, but now I'm running into following error:

check@LAPTOP-LU8L3B35:~/lucaschessR2-main/bin$ python3.8 LucasR.py
Traceback (most recent call last):
  File "LucasR.py", line 16, in <module>
    import Code.Base.Init
  File "/home/check/lucaschessR2-main/bin/Code/Base/Init.py", line 5, in <module>
    from Code import Procesador
  File "/home/check/lucaschessR2-main/bin/Code/Procesador.py", line 80, in <module>
    from Code.Sound import WindowSonido
  File "/home/check/.local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "/home/check/lucaschessR2-main/bin/Code/Sound/WindowSonido.py", line 20, in <module>
    from Code.Sound import Sound
  File "/home/check/.local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "/home/check/lucaschessR2-main/bin/Code/Sound/Sound.py", line 8, in <module>
    from PySide2 import QtCore, QtMultimedia
  File "/home/check/.local/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
ImportError: libpulse-mainloop-glib.so.0: cannot open shared object file: No such file or directory

The error seems to me being similar to this one: [(https://github.com/lukasmonk/lucaschessR2/issues/62)]

lukasmonk commented 1 year ago

I created the version from scratch and for Ubuntu: sudo apt-get install libxcb-xinerama0

In your case, perhaps (search with google): sudo apt-get install -y libpulse-mainloop-glib0

CheckDaniels commented 12 months ago

It finnaly workedヽ(•‿•)ノ.

What I did: I installed as you said "libpulse-mainloop-glib0" and ran LucasR.py, but then I got a new 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, xcb.

Aborted (core dumped)

After a little research. I came across this:. So I added following into the console: export QT_DEBUG_PLUGINS=1 and ran it again. The Error-Output was now more detailed. The end of the error looked like this.

Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() looking at "/home/check/.local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so"
Found metadata in lib /home/check/.local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
Cannot load library /home/check/.local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/check/.local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/check/.local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
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.

Aborted



Apparently not all packages from the xcb libary were installed (see here). To see what packages were missing I wen to the package folder, in my case: cd .local/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms and run following command. ldd libqxcb.so This gave me a list of all installed/missing packages (see here)

I now just installed them seperately (for this I just asked ChatGPT): sudo apt install libxcb1 libxcb-icccm4 libxcb-util1 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 libxcb-image0 libxcb-util1 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0

and ran LucasR.py again and it started.

lukasmonk commented 12 months ago

Good work!