Repository navigation
Python 3.11 support (src/_rtmidi.cpp:243:12: fatal error: longintrepr.h: No such file or directory) #115
Copy link
Copy link
Closed
Description
Hi, installing via pip on Python 3.11.0 on linux, I get
$ pip install python-rtmidi
Collecting python-rtmidi
Using cached python-rtmidi-1.4.9.tar.gz (251 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: python-rtmidi
DEPRECATION: python-rtmidi is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for python-rtmidi ... error
error: subprocess-exited-with-error
× Running setup.py install for python-rtmidi did not run successfully.
│ exit code: 1
╰─> [46 lines of output]
/tmp/pip-install-7hrewfls/python-rtmidi_71d122c223504a2ebead28914de163d0/setup.py:27: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
JACK1_MIN_VERSION = StrictVersion('0.125.0')
/tmp/pip-install-7hrewfls/python-rtmidi_71d122c223504a2ebead28914de163d0/setup.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
JACK2_MIN_VERSION = StrictVersion('1.9.11')
/tmp/pip-install-7hrewfls/python-rtmidi_71d122c223504a2ebead28914de163d0/setup.py:45: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
jv = StrictVersion(res.decode())
Detected JACK version 1.9.20.
JACK version is recent enough to have 'jack_port_rename' function.
running install
/home/alex/.pyenv/versions/3.11.0/envs/midivis/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/rtmidi
copying rtmidi/midiutil.py -> build/lib.linux-x86_64-cpython-311/rtmidi
copying rtmidi/midiconstants.py -> build/lib.linux-x86_64-cpython-311/rtmidi
copying rtmidi/__init__.py -> build/lib.linux-x86_64-cpython-311/rtmidi
copying rtmidi/version.py -> build/lib.linux-x86_64-cpython-311/rtmidi
running egg_info
writing python_rtmidi.egg-info/PKG-INFO
writing dependency_links to python_rtmidi.egg-info/dependency_links.txt
writing top-level names to python_rtmidi.egg-info/top_level.txt
reading manifest file 'python_rtmidi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '*.rst.in'
no previously-included directories found matching 'ci'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
adding license file 'LICENSE.txt'
adding license file 'AUTHORS.rst'
writing manifest file 'python_rtmidi.egg-info/SOURCES.txt'
running build_ext
building 'rtmidi._rtmidi' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/src
creating build/temp.linux-x86_64-cpython-311/src/rtmidi
gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__RTMIDI_SILENCE_WARNINGS__ -D__LINUX_ALSA__ -D__UNIX_JACK__ -DJACK_HAS_PORT_RENAME -Isrc/rtmidi -I/home/alex/.pyenv/versions/3.11.0/envs/midivis/include -I/home/alex/.pyenv/versions/3.11.0/include/python3.11 -c src/_rtmidi.cpp -o build/temp.linux-x86_64-cpython-311/src/_rtmidi.o
src/_rtmidi.cpp:243:12: fatal error: longintrepr.h: No such file or directory
243 | #include "longintrepr.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> python-rtmidi
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
This seems to be related to python/cpython#28968, where longintrepr.h was moved to cpython/longintrepr.h.
src/_rtmidi.cpp in the .tar.gz that Pip downloads seems to be generated with Cython, so presumably needs to be re-generated with a version of Cython that's aware of this change.
For the record, I was able to successfully install from source (following the instructions from here) and otherwise everything seems to be working fine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Bubobubobubobubo commentedon Oct 27, 2022
Same issue here. Chiming in.
krixgris commentedon Nov 1, 2022
Also running into the same issue.
I'm getting this error on Mac OS but the same actualy error with longintrepr.h not found.
Bubobubobubobubo commentedon Nov 14, 2022
It looks like #108 and #115 could be resolved by taking a look at #100. This would be greatly helpful for all
python-rtmididependant apps developed since last year, especially those depending onmido(which in turn depends onpython-rtmidi). Can I be of some help for during this update process?liudonghua123 commentedon Nov 23, 2022
I tried to build some wheels based on https://github.com/Czaki/python-rtmidi, see https://github.com/liudonghua123/python-rtmidi/releases/tag/1.4.9 .
Now
python-rtmidiworks on my python 3.11.luckydonald commentedon Dec 31, 2022
Note, to try the merge request of @Czaki, one can use
pip install:krixgris commentedon Dec 31, 2022
Thank you! I am too green to realise you could do that. Tried it this morning and seems to work great.
jenishngl commentedon Feb 7, 2023
This doesnt seem to work for me
georgeharker commentedon Feb 12, 2023
This does work for me - would be great to find a way of getting that in the mainline.
Update python-python-rtmidi to version 1.4.9 / rev 8 via SR 1066960
Bubobubobubobubo commentedon Mar 18, 2023
Bump again. We are vendoring our own python-rtmidi-wheels externally as part of the Sardine project and it would be nice to be able to get back to using
python-rtmidiwithout adding to the installation instructions.rec commentedon Mar 23, 2023
@jenishngl:
I used poetry to successfully install this with the command
poetry add 'git+https://github.com/SpotlightKid/python-rtmidi.git#eb16ab3268b29b94cd2baa6bfc777f5cf5f908ba'@Bubobubobubobubo
You should be able to reference that specific version in your pyproject.toml or your requirements.txt and not require that additional draggy step for your users!
SpotlightKid commentedon Apr 9, 2023
Hi all, please take note of #137
brunoenten commentedon May 21, 2023
Fixed by merging #119
bump rtmidi to 1.5.0 to pick up
Newer python-rtmidi