SpotlightKid / python-rtmidi

Python bindings for the cross-platform MIDI I/O library RtMidi
https://spotlightkid.github.io/python-rtmidi/
Other
356 stars 65 forks source link

Windows 10 system cannot install using Python 38-32-bit parser, installation error #208

Open 517002650 opened 2 months ago

517002650 commented 2 months ago

D:\py\Python38-32\python.exe C:\Users\Administrator\PycharmProjects\pythonProject8\OSC+MIDI11.py Traceback (most recent call last): File "C:\Users\Administrator\PycharmProjects\pythonProject8\OSC+MIDI11.py", line 245, in app = SerialOSCBridgeApp(root) File "C:\Users\Administrator\PycharmProjects\pythonProject8\OSC+MIDI11.py", line 76, in init self.update_midi_devices() File "C:\Users\Administrator\PycharmProjects\pythonProject8\OSC+MIDI11.py", line 114, in update_midi_devices devices = mido.get_output_names() File "D:\py\Python38-32\lib\site-packages\mido\backends\backend.py", line 180, in get_output_names devices = self._get_devices(**self._add_api(kwargs)) File "D:\py\Python38-32\lib\site-packages\mido\backends\backend.py", line 167, in _get_devices if hasattr(self.module, 'get_devices'): File "D:\py\Python38-32\lib\site-packages\mido\backends\backend.py", line 47, in module self.load() File "D:\py\Python38-32\lib\site-packages\mido\backends\backend.py", line 63, in load self._module = importlib.import_module(self.name) File "D:\py\Python38-32\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "D:\py\Python38-32\lib\site-packages\mido\backends\rtmidi.py", line 11, in import rtmidi ModuleNotFoundError: No module named 'rtmidi'

进程已结束,退出代码为 1

SpotlightKid commented 2 months ago

It seems you are trying to run Python program, which uses mido. Mido can use python-rtmidi as a backend, but you have to specify, which backends to install, when you install mido:

https://mido.readthedocs.io/en/stable/installing.html#installation

517002650 commented 2 months ago

Windows PowerShell 版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS C:\Users\Administrator\PycharmProjects\pythonProject8> pip install python-rtmidi Collecting python-rtmidi Using cached python_rtmidi-1.5.8.tar.gz (368 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [31 lines of output]

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

517002650 commented 2 months ago

It seems you are trying to run Python program, which uses mido. Mido can use python-rtmidi as a backend, but you have to specify, which backends to install, when you install mido:

https://mido.readthedocs.io/en/stable/installing.html#installation

Windows PowerShell 版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS C:\Users\Administrator\PycharmProjects\pythonProject8> python -m pip install mido[ports-rtmidi] Requirement already satisfied: mido[ports-rtmidi] in d:\py\python38-32\lib\site-packages (1.3.2) Requirement already satisfied: packaging~=23.1 in d:\py\python38-32\lib\site-packages (from mido[ports-rtmidi]) (23.2) Collecting python-rtmidi~=1.5.4 (from mido[ports-rtmidi]) Using cached python_rtmidi-1.5.8.tar.gz (368 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [31 lines of output]

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. PS C:\Users\Administrator\PycharmProjects\pythonProject8>

SpotlightKid commented 2 months ago

You are trying to build python-rtmidi with a 32-bit version of Python on a 64-bit version of windows. Also, your Python version (3.8) is rather old, and support for it will end in two months:

https://www.python.org/downloads/

The python-rtmidi project does not provide binary wheels for windows and Python version 3.8. So you are on your own there, sorry. I don't have the capacity to support that.

Try upgrading your Python installation to the latest 64-bit version.

517002650 commented 2 months ago

You are trying to build python-rtmidi with a 32-bit version of Python on a 64-bit version of windows. Also, your Python version (3.8) is rather old, and support for it will end in two months:You are trying to build python-rtmidi with a 32-bit version of Python on a 64-bit version of windows. Also, your Python version (3.8) is rather old, and support for it will end in two months:您正在尝试在 64 位版本的 Windows 上使用 32 位版本的 Python 构建 python-rtmidi。此外,您的 Python 版本 (3.8) 相当旧,对它的支持将在两个月后结束:

https://www.python.org/downloads/https://www.python.org/downloads/ https://www.python.org/downloads/

The python-rtmidi project does not provide binary wheels for windows and Python version 3.8. So you are on your own there, sorry. I don't have the capacity to support that.The python-rtmidi project does not provide binary wheels for windows and Python version 3.8. So you are on your own there, sorry. I don't have the capacity to support that.python-rtmidi 项目不提供适用于 Windows 和 Python 版本 3.8 的二进制轮子。所以你只能靠自己了,对不起。我没有能力支持这一点。

Try upgrading your Python installation to the latest 64-bit version.Try upgrading your Python installation to the latest 64-bit version.尝试将 Python 安装升级到最新的 64 位版本。

Which Python version 32-bit is supported by Python rtmidi library,I want to use 32-bit Python

SpotlightKid commented 2 months ago

I'm not sure. The python-rtmidi project only provides binary wheels for 64-bit Python on Windows. These are built by our CI (GitHub actions). I don't have a Windows system to test building different combinations myself.

You can try building python-rtmidi manually from the source yourself:

https://spotlightkid.github.io/python-rtmidi/install-windows.html

Try with the latest Python 3.12.5, I guess.

Alternatively, you can check whether you have more luck with other midi backends.