EldinZenderink / MidiController

Blender plugin to control object properties through midi.
MIT License
0 stars 0 forks source link

Solved issue: cannot install rtmidi "Did not find python binary to use!" on Ubuntu 22.04 #1

Open ThomZenTury opened 3 days ago

ThomZenTury commented 3 days ago

Hi there! Thanks for the useful addon. I was having some trouble installing the rtmidi dependency and just wanted to let you know that it's somehow easy to solve.

OS: Ubuntu Studio / Kubuntu 22.04.4 LTS x86_64

Everything works fine (installing and activating the addon in Blender's GUI) until the part where I should install the .whl package / rtmidi module. Your installation script threw the error:

"Did not find python binary to use!" 

from line 1172.

Solution:

Find blender's own python executable and replace the path variable within the initialization script.

Blender comes with its own bundled Python interpreter. You need to find where this interpreter is located.

  1. Open Blender.

  2. Go to the Scripting tab.

  3. In the Python console within Blender, run the following command to find the path to the Python executable:

    import sys
    print(sys.executable)

    This will print the path to Blender's Python executable, which will look something like

    /path/to/blender/3.3/python/bin/python3.10
  4. With this information open the init.py file that threw the error. In my case it was located here:

    /home/user/.config/blender/3.3/scripts/addons/MidiController/__init__.py
  5. And in line 1145 replace the "python_path" variable with the path you got from step 3. It should look something like that:

    # python_path = MidiController_Dependencies.get_python_executable()
    python_path = "/software/blender/blender-3.3.1-linux-x64/3.3/python/bin/python3.10"
  6. Save the init.py file

  7. Restart Blender

  8. Try again to install the rtmidi dependency from within Blender

  9. Solved my case

I hope this can be useful for someone.

Have a nice day!

EldinZenderink commented 5 hours ago

Thank you!

Must admit I did not do any compatibility checking on any other operating system than Windows.

My self-admittly hacky dependency installer for python appears not to take into account that python binaries on other operatin systems contain the version number in their binary file name.

On windows its just 'python.exe' ;).

I will try and see if I can make the dependency installer a bit more generic to handle these situations.