RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Unable to install binary for joy2key

    Scheduled Pinned Locked Moved Help and Support
    setup joy2key
    19 Posts 2 Posters 730 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yserra
      last edited by

      RetroPie-Setup version: 4.8.7 (2c955ef0)
      System: rpi4 (armv7l) - Raspbian GNU/Linux 10 (buster) - Linux retropie 5.10.103-v7l+ #1529
      Gamepad : random chinese PS3-like USB Gamepad, known as "USB Gamepad" under EmulationStation

      When I try to update Retropie, here is the message I get (from the log):

      = = = = = = = = = = = = = = = = = = = = =
      Installing dependencies for 'joy2key' : Provides joystick to keyboard conversion for navigation of RetroPie dialog menus
      = = = = = = = = = = = = = = = = = = = = =
      
      
      = = = = = = = = = = = = = = = = = = = = =
      Installing (binary) 'joy2key' : Provides joystick to keyboard conversion for navigation of RetroPie dialog menus
      = = = = = = = = = = = = = = = = = = = = =
      
      Compiling '/opt/retropie/admin/joy2key/joy2key.py'...
      Compiling '/opt/retropie/admin/joy2key/joy2key_sdl.py'...
      Compiling '/opt/retropie/admin/joy2key/osk.py'...
      Unable to install binary for joy2key
      

      I can no more use my gamepad to select items in the Retropie setup text screens. The gamepad works without any issue under EmulationStation and Emulators.

      Would you have any idea of the issue? I searched in the forum for this exact error 'Unable to install binary for joy2key' but couldn't find anything helpful.

      Just to be sure, I reconfigured the gamepad under EmulationStation. That changed nothing.

      Under bash, the command 'joy2key_sdl.py' is not found.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Please fill out the complete info asked in https://retropie.org.uk/forum/topic/3/read-this-first.
        Do you have enough free space available on your system ?

        Y 1 Reply Last reply Reply Quote 0
        • Y
          yserra @mitu
          last edited by yserra

          @mitu Thank you for your answer.

          Ok, I suspect "RetroPie-Setup version: 4.8.7 (2c955ef0)
          System: rpi4 (armv7l) - Raspbian GNU/Linux 10 (buster) - Linux retropie 5.10.103-v7l+ #1529
          Gamepad : random chinese PS3-like USB Gamepad, known as "USB Gamepad" under EmulationStation" wasn't formatted as you expected. Here is:

          Pi Model or other hardware: rpi4 (armv7l)
          Power Supply used: a dedicated Meanwell
          RetroPie Version Used 4.8.7 (Raspbian GNU/Linux 10 (buster) - Linux retropie 5.10.103-v7l+)
          Built From: RetroPie website
          USB Devices connected: random chinese PS3-like USB Gamepad, known as "USB Gamepad" under EmulationStation"
          Controller used: random chinese PS3-like USB Gamepad, known as "USB Gamepad" under EmulationStation"
          Error messages received: Unable to install binary for joy2key
          Verbose log (if relevant): Unable to install binary for joy2key
          Guide used: I didn't follow a guide
          File: I would like to know if this error is related to a file...
          Emulator: It's not related to an emulator.

          "Do you have enough free space available on your system ?"

          df says:

          /dev/root          122641480   9300024  108319032   8% /
          devtmpfs             1709220         0    1709220   0% /dev
          tmpfs                1874084         0    1874084   0% /dev/shm
          tmpfs                1874084     10052    1864032   1% /run
          tmpfs                   5120         4       5116   1% /run/lock
          tmpfs                1874084         0    1874084   0% /sys/fs/cgroup
          /dev/loop1               128       128          0 100% /snap/bare/5
          /dev/loop2             91264     91264          0 100% /snap/core/16932
          /dev/loop0             47232     47232          0 100% /snap/core18/2807
          /dev/loop3             92800     92800          0 100% /snap/core/16207
          /dev/loop5             93952     93952          0 100% /snap/gtk-common-themes/1535
          /dev/loop4             83328     83328          0 100% /snap/gtk-common-themes/1534
          /dev/loop6             47232     47232          0 100% /snap/core18/2799
          /dev/mmcblk0p1        261868     51192     210676  20% /boot
          /dev/sda1          960348184 139586868  771908580  16% /media/usb0
          tmpfs                 374816         0     374816   0% /run/user/1000
          

          My boot SD Card is 128 GB. My ROMs are on a external 1TB HD

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by mitu

            OK, so there is enough space on /opt/retropie to install or update joy2key. When did you last run an update ? Did you have any errors on the previous update ?

            Could you run, from a command line outside EmulationStation, the following command:

            cd $HOME/RetroPie-Setup; sudo __debug=1 ./retropie_packages.sh joy2key 2> $HOME/log.txt
            

            then upload the $HOME/log.txt file on pastebin.com to see the detailed log ?

            Y 1 Reply Last reply Reply Quote 0
            • Y
              yserra @mitu
              last edited by

              @mitu

              "Did you have any errors on the previous update?"

              Actually, I don't remember when this error started. I would say somewhere around february, this year. The error appears at every update since then.

              "upload the $HOME/log.txt file on pastebin.com to see the detailed log"

              The given command created a 815KB file.
              Pastebin says:

              "You have exceeded the maximum size of 512 kilobytes per Paste."

              So I uploaded the log.txt file onto my Google drive. Here is the link:

              https://drive.google.com/drive/folders/1z3xSol8kyHC1MiR4m9W8MzOkEpvLmc4M?usp=sharing

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @yserra
                last edited by

                I've looked at the log file, but I don't see anything that resembles an error, though it may have some issues with the package's retropie.pkg installation file. Can you try uninstalling the package and then installing it again, from scratch ?

                Y 1 Reply Last reply Reply Quote 0
                • Y
                  yserra @mitu
                  last edited by

                  @mitu Thank you for your answer. But before doing this, can you confirm that replacing the package retropie.pkg won't erase any customization I added to Retropie (mainly all retroarch.cfg files and everything that is in the /opt directory)?

                  Because, to be honest, if the solution is to restart from scratch a Retropie installation, with hours of reconfiguration, I think I can live with using my USB keyboard only to navigate in the text menus...

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @yserra
                    last edited by mitu

                    @yserra said in Unable to install binary for joy2key:

                    @mitu Thank you for your answer. But before doing this, can you confirm that replacing the package retropie.pkg won't erase any customization I added to Retropie (mainly all retroarch.cfg files and everything that is in the /opt directory)?

                    I don't see how they are related, retropie.pkg is just something internally used by the packaging system.

                    Because, to be honest, if the solution is to restart from scratch a Retropie installation, with hours of reconfiguration, I think I can live with using my USB keyboard only to navigate in the text menus...

                    I suggested to remove and add back 1 package, not the entire installation, I fail to see how that is restarting from scratch a RetroPie installation.

                    Y 1 Reply Last reply Reply Quote 0
                    • Y
                      yserra @mitu
                      last edited by

                      @mitu Could you please tell me how I can de-install and re-install retropie.pkg?

                      After running the script /home/pi/RetroPie-Setup/retropie_setup.sh, I don't see it in the "Manage all installed packages" menu:

                      screenshot_1325.png

                      Nor in the "Manage Core packages" menu :

                      screenshot_1324.png

                      Nor in the "Manage all packages" menu:

                      screenshot_1326.png

                      Apparently, there is no mention of "retropie.pkg" on https://retropie.org.uk/docs/ :

                      screenshot_1327.png

                      And this page: https://retropie.org.uk/stats/pkgflags/ doesn't mention it.

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @yserra
                        last edited by

                        @yserra I was referring to the joy2key package, there's no retropie.pkg package. Remove and then install joy2key.

                        Y 1 Reply Last reply Reply Quote 0
                        • Y
                          yserra @mitu
                          last edited by

                          @mitu Ok, thank your for your answer. Yes, it works better with the name joy2key.

                          So, here is the very strange things that happens:

                          When I'm working on Retropie with SSH from my remote Mac (ssh pi@192.168.xxx.xxx):

                          • I can remove joy2key
                          • I can reinstall joy2key without any issue
                          • I can update Retropie without any error message about joy2key

                          That sounds good.
                          But.

                          When I go back physically to my Retropie, I mean physically using my Raspberry Pi 4's USB joypad, USB keyboard, HDMI monitor, and accessing a Shell session (after quitting EmulationStation, or via EmulationStation's 'Retropie Setup' menu entry ; I tried both):

                          • Still impossible to navigate in retropie-setup.sh menus with the joypad
                          • updating Retropie still leads to the error "Unable to install binary for joy2key"
                          • I can remove joy2key package
                          • I cannot reinstall joy2key package ("Unable to install binary for joy2key")

                          From both the ssh session and the Raspberry's console, the following commands gave the exact same results:

                          pi@retropie:~/RetroPie-Setup $ whoami
                          pi
                          pi@retropie:~/RetroPie-Setup $ echo $0
                          -bash
                          
                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @yserra
                            last edited by

                            @yserra Seems like there's an issue with running joy2key, if the command is stuck with an error that might explain why the install/update is not working. On a SSH session, there's no joy2key started, so the update/install works normally.

                            Can your run, from a SSH session or straight from the terminal, the following command and post the output:

                            /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                            
                            Y 1 Reply Last reply Reply Quote 1
                            • Y
                              yserra @mitu
                              last edited by yserra

                              @mitu The command says:

                              pi@retropie:/opt/retropie/admin/joy2key $ ./joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                              Traceback (most recent call last):
                                File "/opt/retropie/admin/joy2key/./joy2key_sdl.py", line 38, in <module>
                                  from sdl2 import joystick, events, version, \
                              ModuleNotFoundError: No module named 'sdl2'
                              

                              So, I did the following:

                              pi@retropie:~ $ pip install -U pysdl2
                              ,,,
                              pi@retropie:~ $ pip install -U git+https://github.com/py-sdl/py-sdl2.git
                              

                              After installing pysdl2, your command says something new:

                              pi@retropie:~ $ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                              pi@retropie:~ $ 2024-05-05 01:40:41,147 DEBUG  Using SDL Version 2.0.10, PySDL2 version 0.9.17
                              2024-05-05 01:40:41,149 DEBUG  Joystick #0  USB Gamepad           added
                              2024-05-05 01:40:41,150 DEBUG  Added configuration for known device  USB Gamepad          , hats: {0: [(1, 'up'), (8, 'left'), (2, 'right'), (4, 'down')]}, buttons: {4: 'pageup', 5: 'pagedown', 3: 'y', 0: 'x', 2: 'b', 1: 'a'}, axis: {2: [(-1, 'up'), (1, 'down')], 3: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')], 0: [(1, 'right'), (-1, 'left')]}
                              

                              I actually tried your command also directly on my Raspberry Pi (not by SSH, directly on the Raspberry Pi 4B console), and... THEN, the gamepad works!

                              Well, it shows lot of 'DEBUG events emitted...", but it works to navigate in the RetroPie-Setup menus.

                              But it doesn't survive a reboot.

                              So the final question would be: Why does it work when the command is entered manually, but not automatically?

                              And why does it still says 'Unable to install binary for joy2key' when I update, again, ever, after all this?

                              mituM 1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator @yserra
                                last edited by mitu

                                @mitu The command says:

                                pi@retropie:/opt/retropie/admin/joy2key $ ./joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                                Traceback (most recent call last):
                                  File "/opt/retropie/admin/joy2key/./joy2key_sdl.py", line 38, in <module>
                                    from sdl2 import joystick, events, version, \
                                ModuleNotFoundError: No module named 'sdl2'
                                

                                That's strange, since the the joy2key package is dependant on the python3-sdl2 Debian package, which should have been subsequently installed.

                                So, I did the following:

                                pi@retropie:~ $ pip install -U git+https://github.com/py-sdl/py-sdl2.git
                                

                                That works too, though I'm not sure how well the new python3-sdl2 supports older versions of SDL2.

                                After installing pysdl2, your command says something new:...

                                Yes, this looks like normal usage.

                                I actually tried your command also directly on my Raspberry Pi ...
                                Well, it shows lot of 'DEBUG events emitted...", but it works to navigate in the RetroPie-Setup menus.

                                But it doesn't survive a reboot.

                                Yes, joy2key is not a persistent command, it's only started when needed by the dialog menus.

                                So the final question would be: Why does it work when the command is entered manually, but not automatically?

                                And why does it still says 'Unable to install binary for joy2key' when I update, again, ever, after all this?

                                I can't tell, maybe some pysdl2 issue with your installation ? Did you install from source python3 or installed a 3rd party package for python3 ? What's the output of the commands:

                                 dpkg -l | grep python3-sdl2
                                python3 -V
                                
                                Y 1 Reply Last reply Reply Quote 0
                                • Y
                                  yserra @mitu
                                  last edited by

                                  @mitu said in Unable to install binary for joy2key:

                                  Did you install from source python3 or installed a 3rd party package for python3 ?

                                  Thank you for your answer. I may have changed something with the Python3 installation before, to install the Greaseweazle command-line (which lets using a real floppy drive with the Amiga emulator Amiberry). But I honestly don't remember what.
                                  Here is what Greaseweazle tells to install its software: https://github.com/keirf/greaseweazle/wiki/Software-Installation

                                  The commands say:

                                  pi@retropie:~ $ dpkg -l | grep python3-sdl2
                                  ii  python3-sdl2                         0.9.3+dfsg2-1                            all          Python bindings to the SDL2 C-library (Python 3 build)
                                  pi@retropie:~ $ python3 -V
                                  Python 3.11.4
                                  
                                  mituM 1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @yserra
                                    last edited by

                                    @yserra said in Unable to install binary for joy2key:

                                    Here is what Greaseweazle tells to install its software: https://github.com/keirf/greaseweazle/wiki/Software-Installation

                                    The installation instructions here show how to install the Python3 package for GW, however...

                                    The commands say:

                                    pi@retropie:~ $ dpkg -l | grep python3-sdl2
                                    ii python3-sdl2 0.9.3+dfsg2-1 all Python bindings to the SDL2 C-library (Python 3 build)
                                    pi@retropie:~ $ python3 -V
                                    Python 3.11.4

                                    The system python3 version is not 3.11.4, but 3.7.3, which means you manually installed a 3rd party (i.e. not shipped with the RaspiOS version) python3 package. So the reason the command is not working OOB is because the python3-sdl2 package is tailored for the older python3 version, but you don't have that version anymore.

                                    You installed pysdl2 manually, but for the pi user, whereas the RetroPie-Setup script is running as root and it still gets the error caused by a new python3 version and older (and incompatible) python3-sdl2 package.

                                    Y 1 Reply Last reply Reply Quote 0
                                    • Y
                                      yserra @mitu
                                      last edited by

                                      @mitu Thank you for this clear explanation. What would be the best way to solve that situation (if it's solvable)?

                                      Should I wget an older Python 3.7, sudo install it then sudo ln -s it? Or should I give up, since I would risk to generate a perfect mess?

                                      mituM 1 Reply Last reply Reply Quote 0
                                      • mituM
                                        mitu Global Moderator @yserra
                                        last edited by

                                        @yserra said in Unable to install binary for joy2key:

                                        Should I wget an older Python 3.7, sudo install it then sudo ln -s it? Or should I give up, since I would risk to generate a perfect mess?

                                        Try to run the pip installation commands from under the root account and see if that solves the issue. You could downgrade the Python version, but since Greaseweasel needs 3.8, it won't work after the downgrade.

                                        Y 1 Reply Last reply Reply Quote 1
                                        • Y
                                          yserra @mitu
                                          last edited by

                                          @mitu Hi Mitu, just to tell you that:

                                          pi@retropie:~ $ sudo pip3 install -U git+https://github.com/marcusva/py-sdl2.git
                                          

                                          ...solved the problem.

                                          Now, I don't get anymore the 'Unable to install binary for joy2key' during a Retropie update and, now, I can navigate in the retropie-setup menus with my joypad. And, it has been verified after a reboot, also.

                                          So, many thanks for your great help!

                                          Have a great day.

                                          1 Reply Last reply Reply Quote 0
                                          • A anton2026 referenced this topic on
                                          • First post
                                            Last post

                                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.