• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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.
  • M
    mitu Global Moderator @yserra
    last edited by 3 May 2024, 16:29

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

    Y 1 Reply Last reply 3 May 2024, 21:46 Reply Quote 0
    • Y
      yserra @mitu
      last edited by 3 May 2024, 21:46

      @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
      
      M 1 Reply Last reply 4 May 2024, 04:21 Reply Quote 0
      • M
        mitu Global Moderator @yserra
        last edited by 4 May 2024, 04:21

        @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 4 May 2024, 23:19 Reply Quote 1
        • Y
          yserra @mitu
          last edited by yserra 5 May 2024, 01:20 4 May 2024, 23:19

          @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?

          M 1 Reply Last reply 5 May 2024, 04:31 Reply Quote 0
          • M
            mitu Global Moderator @yserra
            last edited by mitu 5 May 2024, 05:31 5 May 2024, 04:31

            @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 5 May 2024, 10:31 Reply Quote 0
            • Y
              yserra @mitu
              last edited by 5 May 2024, 10:31

              @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
              
              M 1 Reply Last reply 5 May 2024, 14:06 Reply Quote 0
              • M
                mitu Global Moderator @yserra
                last edited by 5 May 2024, 14:06

                @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 5 May 2024, 14:44 Reply Quote 0
                • Y
                  yserra @mitu
                  last edited by 5 May 2024, 14:44

                  @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?

                  M 1 Reply Last reply 5 May 2024, 15:05 Reply Quote 0
                  • M
                    mitu Global Moderator @yserra
                    last edited by 5 May 2024, 15:05

                    @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 8 May 2024, 15:55 Reply Quote 1
                    • Y
                      yserra @mitu
                      last edited by 8 May 2024, 15:55

                      @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 2 Dec 2024, 20:30
                      19 out of 19
                      • First post
                        19/19
                        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.

                        This community forum collects and processes your personal information.
                        consent.not_received