I'm on a Mac currently running OS 10.13 (High Sierra.) There are no problems at all with installing rtmidi with python 2.7 (because of wheels...?) but no such luck for python 3.7.1. The errors hint to me that perhaps the CoreMIDI headers have changed.
$ pip install rtmidi==2.3.4
Collecting rtmidi==2.3.4
Downloading https://files.pythonhosted.org/packages/80/a6/23e6fdbede1914bc1a12e3e5cdc97c3de7fccc1507126a0736dd741f0a81/rtmidi-2.3.4.tar.gz (51kB)
100% |████████████████████████████████| 61kB 1.4MB/s
Building wheels for collected packages: rtmidi
Running setup.py bdist_wheel for rtmidi ... error
Complete output from command /Users/mark/.virtualenvs/music/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-install-qvpnderi/rtmidi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-wheel-equceuj7 --python-tag cp37:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'headers'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/randomout.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/collector.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
running build_ext
building 'rtmidi._rtmidi' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/cpp_src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -D__MACOSX_CORE__= -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c cpp_src/RtMidi.cpp -o build/temp.macosx-10.9-x86_64-3.7/cpp_src/RtMidi.o -Wno-missing-braces
In file included from /System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h:18:0,
from cpp_src/RtMidi.cpp:379:
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:300:2: error: expected unqualified-id before '^' token
(^MIDINotifyBlock)(const MIDINotification *message);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:300:2: error: expected ')' before '^' token
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:343:2: error: expected unqualified-id before '^' token
(^MIDIReadBlock)(const MIDIPacketList *pktlist, void * __nullable srcConnRefCon);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:343:2: error: expected ')' before '^' token
In file included from /System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h:18:0,
from cpp_src/RtMidi.cpp:379:
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1154:6: error: 'MIDINotifyBlock' has not been declared
MIDINotifyBlock __nullable notifyBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1240:9: error: 'MIDIReadBlock' has not been declared
MIDIReadBlock readBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1643:9: error: 'MIDIReadBlock' has not been declared
MIDIReadBlock readBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
In file included from /usr/include/Availability.h:206:0,
from /usr/include/wchar.h:72,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/cwchar:44,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/bits/postypes.h:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iosfwd:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ios:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ostream:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iostream:39,
from cpp_src/RtMidi.h:49,
from cpp_src/RtMidi.cpp:39:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:294:43: error: expected '}' before '__attribute__'
kFSEventStreamCreateFlagUseExtendedData __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_11_0) = 0x00000040
^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
from cpp_src/RtMidi.cpp:381:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:294:96: error: expected unqualified-id before '=' token
kFSEventStreamCreateFlagUseExtendedData __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_11_0) = 0x00000040
^
In file included from /usr/include/Availability.h:206:0,
from /usr/include/wchar.h:72,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/cwchar:44,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/bits/postypes.h:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iosfwd:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ios:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ostream:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iostream:39,
from cpp_src/RtMidi.h:49,
from cpp_src/RtMidi.cpp:39:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:520:41: error: expected '}' before '__attribute__'
kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
from cpp_src/RtMidi.cpp:381:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:520:93: error: expected unqualified-id before '=' token
kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
^
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:533:1: error: expected declaration before '}' token
};
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for rtmidi
Running setup.py clean for rtmidi
Failed to build rtmidi
Installing collected packages: rtmidi
Running setup.py install for rtmidi ... error
Complete output from command /Users/mark/.virtualenvs/music/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-install-qvpnderi/rtmidi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-record-m0pu_ssa/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mark/.virtualenvs/music/bin/../include/site/python3.7/rtmidi:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'headers'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/randomout.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/collector.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
copying rtmidi/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/rtmidi
running build_ext
building 'rtmidi._rtmidi' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/cpp_src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -D__MACOSX_CORE__= -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c cpp_src/RtMidi.cpp -o build/temp.macosx-10.9-x86_64-3.7/cpp_src/RtMidi.o -Wno-missing-braces
In file included from /System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h:18:0,
from cpp_src/RtMidi.cpp:379:
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:300:2: error: expected unqualified-id before '^' token
(^MIDINotifyBlock)(const MIDINotification *message);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:300:2: error: expected ')' before '^' token
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:343:2: error: expected unqualified-id before '^' token
(^MIDIReadBlock)(const MIDIPacketList *pktlist, void * __nullable srcConnRefCon);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:343:2: error: expected ')' before '^' token
In file included from /System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h:18:0,
from cpp_src/RtMidi.cpp:379:
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1154:6: error: 'MIDINotifyBlock' has not been declared
MIDINotifyBlock __nullable notifyBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1240:9: error: 'MIDIReadBlock' has not been declared
MIDIReadBlock readBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1643:9: error: 'MIDIReadBlock' has not been declared
MIDIReadBlock readBlock ) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
^
In file included from /usr/include/Availability.h:206:0,
from /usr/include/wchar.h:72,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/cwchar:44,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/bits/postypes.h:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iosfwd:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ios:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ostream:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iostream:39,
from cpp_src/RtMidi.h:49,
from cpp_src/RtMidi.cpp:39:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:294:43: error: expected '}' before '__attribute__'
kFSEventStreamCreateFlagUseExtendedData __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_11_0) = 0x00000040
^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
from cpp_src/RtMidi.cpp:381:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:294:96: error: expected unqualified-id before '=' token
kFSEventStreamCreateFlagUseExtendedData __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_11_0) = 0x00000040
^
In file included from /usr/include/Availability.h:206:0,
from /usr/include/wchar.h:72,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/cwchar:44,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/bits/postypes.h:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iosfwd:40,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ios:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/ostream:38,
from /usr/local/Cellar/gcc/4.8.2_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.2/include/c++/iostream:39,
from cpp_src/RtMidi.h:49,
from cpp_src/RtMidi.cpp:39:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:520:41: error: expected '}' before '__attribute__'
kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
from cpp_src/RtMidi.cpp:381:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:520:93: error: expected unqualified-id before '=' token
kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
^
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:533:1: error: expected declaration before '}' token
};
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/mark/.virtualenvs/music/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-install-qvpnderi/rtmidi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-record-m0pu_ssa/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mark/.virtualenvs/music/bin/../include/site/python3.7/rtmidi" failed with error code 1 in /private/var/folders/2m/xgqv_dkn2bvb_j4bf8qdky7c0000gn/T/pip-install-qvpnderi/rtmidi/