Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on Python 3.6 (32 and 64 bit) and on Python 2.7 64 bit. #11

Open
guilbut opened this issue Sep 14, 2017 · 13 comments
Open

Comments

@guilbut
Copy link

guilbut commented Sep 14, 2017

Hi,

Thanks you for your amazing pyrtmidi that i'm using on python 2.7 32 bit !
I would like to use it in Python 3.6 (32 and 64 bit) and on Python 2.7 64 bit, but I have some difficulties to install PyRtmidi on this python versions. "pip install rtmidi" doesn't work .
on ptyhon 2.7 64 bit , I have the error : LINK : fatal error LNK1181: cannot open input file 'python34.lib'
on python 3.6 (32 & 64 bit) i have the errors : LINK : fatal error LNK1181: cannot open input file 'winmm.lib'

I'm very sad, because if I switch to python-rtmidi or rtmidi-python I will lose your MidiMessage capability and will have to recode a lot of things.

Do you plan to release wheels ?

I tried to build it from source, but did'nt succeed.

For python 2.7 64 bit I tried :

  1. Install Microsoft Visual C++ Compiler for Python 2.7 (https://www.microsoft.com/en-us/download/details.aspx?id=44266)

  2. git clone https://github.com/patrickkidd/pyrtmidi

  3. modify "pyrtmidi/septup.py"
    libraries = ['winmm', 'python34'] => libraries = ['winmm', 'python27']
    library_dirs = ['C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib']
    =>
    library_dirs = ['C:/Users/Guilbut/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0/WinSDK/Lib/x64']

  4. "python setup.py install" give me
    C:....\python-2.7.13.amd64\lib
    \distutils\extension.py:133: UserWarning: Unknown Extension options: 'headers'
    warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\rtmidi
    copying rtmidi_init_.py -> build\lib.win-amd64-2.7\rtmidi
    copying rtmidi\collector.py -> build\lib.win-amd64-2.7\rtmidi
    copying rtmidi\randomout.py -> build\lib.win-amd64-2.7\rtmidi
    running build_ext
    building 'rtmidi._rtmidi' extension
    Traceback (most recent call last):
    File "setup.py", line 126, in
    'Programming Language :: Python :: 3.4',
    File "C:....\python-2.7.13.a
    md64\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\command\install.py", line 563, in run
    self.run_command('build')
    File "C:....\python-2.7.13.a
    md64\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self.build_extension(ext)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\command\build_ext.py", line 499, in build_extension
    depends=ext.depends)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\msvc9compiler.py", line 473, in compile
    self.initialize()
    File "C:....\python-2.7.13.a
    md64\lib\distutils\msvc9compiler.py", line 383, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
    File "C:....\python-2.7.13.a
    md64\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
    ValueError: [u'path']

  5. It tried to modify the VS90COMNTOOLS environnement var without succeed..

For python 3.6 I tried :

  1. Install Visual Studio Community 2017, select the Python development workload and the Native development tools option.
  2. git clone https://github.com/patrickkidd/pyrtmidi
  3. modify "pyrtmidi/septup.py"
    libraries = ['winmm', 'python34'] => libraries = ['winmm', 'python36']
    library_dirs = ['C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib']
    Python 3.6 32 bit :
    =>library_dirs = ['C:/Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x86']
    Python 3.6 64 bit :
    => library_dirs = ['C:/Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64']
  4. Add ..... ;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
    to the PATH environnements variables
  5. Add the environnements variables :
    INCLUDE
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared
    LIB
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib
  6. "python setup.py install" give me :
    C:....\scripts\pyrtmidi>python setup.py install
    C:....\python-3.6.2.amd64\lib\distutils\extension.py:131: UserWarning: Unknown Extension options: 'headers'
    warnings.warn(msg)
    running install
    running build
    running build_py
    running build_ext
    building 'rtmidi.rtmidi' extension
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__WINDOWS_MM
    _= -DPK_WINDOWS=1 -IC:....\python-
    3.6.2.amd64\include -IC:....\python-3.6.2.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" "-IC:\Program Files (x86)\Wi
    ndows Kits\10\Include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /EHsc /Tpcpp_src\RtMi
    di.cpp /Fobuild\temp.win-amd64-3.6\Release\cpp_src\RtMidi.obj /EHsc
    RtMidi.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__WINDOWS_MM__= -DPK_WINDOWS=1 -IC:....\python-
    3.6.2.amd64\include -IC:....\python-3.6.2.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" "-IC:\Program Files (x86)\Wi
    ndows Kits\10\Include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /EHsc /Tpcpp_src\Midi
    Message.cpp /Fobuild\temp.win-amd64-3.6\Release\cpp_src\MidiMessage.obj /EHsc
    MidiMessage.cpp
    cpp_src\MidiMessage.cpp(1055): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\MidiMessage.cpp(1057): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__WINDOWS_MM
    = -DPK_WINDOWS=1 -IC:....\python-
    3.6.2.amd64\include -IC:....\python-3.6.2.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" "-IC:\Program Files (x86)\Wi
    ndows Kits\10\Include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /EHsc /Tpcpp_src\PyMi
    diMessage.cpp /Fobuild\temp.win-amd64-3.6\Release\cpp_src\PyMidiMessage.obj /EHsc
    PyMidiMessage.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__WINDOWS_MM__= -DPK_WINDOWS=1 -IC:....\python-
    3.6.2.amd64\include -IC:....\python-3.6.2.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" "-IC:\Program Files (x86)\Wi
    ndows Kits\10\Include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /EHsc /Tpcpp_src\rtmi
    dimodule.cpp /Fobuild\temp.win-amd64-3.6\Release\cpp_src\rtmidimodule.obj /EHsc
    rtmidimodule.cpp
    cpp_src\rtmidimodule.cpp(50): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(52): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(54): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(56): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(58): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(60): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(62): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    cpp_src\rtmidimodule.cpp(64): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help
    for details.
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\stdio.h(1772): note: voir la déclaration de 'sprintf'
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:/Program Files (x86)/Windows Kits/10/Lib/10.0.15
    063.0/um/x64" /LIBPATH:C:....\python-3.6.2.amd64\libs /LIBPATH:C:....\python-3.6.2.amd64\PCbuild\amd64
    "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" winmm.lib python36.lib /EXPORT:PyInit__rtmidi build\temp.win-amd64-3.6\Release\cpp_src\RtMidi.obj build\temp.win-amd64-3.6\Release
    \cpp_src\MidiMessage.obj build\temp.win-amd64-3.6\Release\cpp_src\PyMidiMessage.obj build\temp.win-amd64-3.6\Release\cpp_src\rtmidimodule.obj /OUT:build\lib.win-amd64-3.6\rtmidi_rtmidi.cp36-win_amd64
    .pyd /IMPLIB:build\temp.win-amd64-3.6\Release\cpp_src_rtmidi.cp36-win_amd64.lib
    Création de la bibliothèque build\temp.win-amd64-3.6\Release\cpp_src_rtmidi.cp36-win_amd64.lib et de l'objet build\temp.win-amd64-3.6\Release\cpp_src_rtmidi.cp36-win_amd64.exp
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp____std_exception_destroy
    RtMidi.obj : error LNK2001: symbole externe non résolu "void __cdecl operator delete[](void *,unsigned int)" (??_V@YAXPAXI@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__EnterCriticalSection@4
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInUnprepareHeader@12
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInOpen@20
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutPrepareHeader@12
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp____acrt_iob_func
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutOpen@20
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__InitializeCriticalSectionAndSpinCount@8
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInReset@4
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__LeaveCriticalSection@4
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) void __cdecl std::_Xbad_alloc(void)" (_imp?_Xbad_alloc@std@@yaxxz)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) void __cdecl std::_Xout_of_range(char const *)" (_imp?_Xout_of_range@std@@YAXPBD@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) __int64 const std::_BADOFF" (_imp?_BADOFF@std@@3_JB)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (_imp?_Xlength_error@std@@YAXPBD@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInPrepareHeader@12
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutUnprepareHeader@12
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInStart@4
    RtMidi.obj : error LNK2001: symbole externe non résolu "void __stdcall eh vector destructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *))" (??_M@YGXPAXIIP6EX0@Z@Z) RtMidi.obj : error LNK2001: symbole externe non résolu __imp____std_exception_copy RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInClose@4 RtMidi.obj : error LNK2001: symbole externe non résolu "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z) RtMidi.obj : error LNK2001: symbole externe non résolu __imp____stdio_common_vfprintf RtMidi.obj : error LNK2001: symbole externe non résolu __imp__Sleep@4 MSVCRT.lib(crtdll.obj) : error LNK2001: symbole externe non résolu __imp__Sleep@4 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInAddBuffer@12 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInGetNumDevs@0 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__DeleteCriticalSection@4 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutShortMsg@8 RtMidi.obj : error LNK2001: symbole externe non résolu ___std_terminate RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutGetNumDevs@0 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutLongMsg@12 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutClose@4 RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInStop@4 RtMidi.obj : error LNK2001: symbole externe non résolu __imp___invalid_parameter_noinfo_noreturn RtMidi.obj : error LNK2001: symbole externe non résolu "void __stdcall eh vector constructor iterator'(void ,unsigned int,unsigned int,void (__thiscall)(void ),void (__thiscall)(void *))" (??_L@Y
    GXPAXIIP6EX0@Z1@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutReset@4
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiInGetDevCapsA@12
    RtMidi.obj : error LNK2001: symbole externe non résolu __imp__midiOutGetDevCapsA@12
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits >::sputn(char const *,__int64)" (_imp
    ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits >::_Lock(void)" (_imp?_Lock@?$ba
    sic_streambuf@DU?$char_traits@D@std@@@std@@UAEXXZ)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits >::_Unlock(void)" (_imp?_Unlock@
    ?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAEXXZ)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits >::showmanyc(void)" (_imp?
    showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JXZ)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits >::xsgetn(char *,__int64)" (
    _imp?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPAD_J@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits >::xsputn(char const *,__int
    64)" (_imp?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPBD_J@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) protected: virtual class std::basic_streambuf<char,struct std::char_traits > * __thiscall std::basic_streambuf<char,
    struct std::char_traits >::setbuf(char *,__int64)" (_imp?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PAD_J@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: __int64 __thiscall std::ios_base::width(__int64)" (_imp?width@ios_base@std@@QAE_J_J@Z)
    RtMidi.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: __int64 __thiscall std::ios_base::width(void)const " (_imp?width@ios_base@std@@QBE_JXZ)
    MidiMessage.obj : error LNK2001: symbole externe non résolu ___report_rangecheckfailure
    MidiMessage.obj : error LNK2001: symbole externe non résolu __imp____stdio_common_vsprintf
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyBool_FromLong
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyBytes_AsString
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyLong_FromLong
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp___Py_NoneStruct
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyFloat_FromDouble
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp___Py_FalseStruct
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyType_IsSubtype
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyTuple_GetItem
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyLong_AsLong
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyBytes_FromStringAndSize
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp___Py_NotImplementedStruct
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp___Py_TrueStruct
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyUnicode_FromString
    PyMidiMessage.obj : error LNK2001: symbole externe non résolu __imp__PyArg_ParseTuple
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyThreadState_Get
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyEval_SaveThread
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__Py_BuildValue
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyGILState_Release
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyDict_SetItemString
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__CreateMutexA@12
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyErr_SetString
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__WaitForSingleObject@8
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__ReleaseMutex@4
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyErr_Format
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyFloat_Type
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyLong_Type
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyModule_AddObject
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyModule_Create2
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyType_Ready
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyErr_NewException
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__SetEvent@4
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyThreadState_SetAsyncExc
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__CloseHandle@4
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyEval_InitThreads
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyGILState_Ensure
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyExc_TypeError
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyObject_IsTrue
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyCallable_Check
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__CreateEventA@16
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyEval_RestoreThread
    rtmidimodule.obj : error LNK2001: symbole externe non résolu __imp__PyEval_CallObjectWithKeywords
    MSVCRT.lib(crtdll.obj) : error LNK2001: symbole externe non résolu __imp__InterlockedExchange@8
    MSVCRT.lib(crtdll.obj) : error LNK2001: symbole externe non résolu __imp__InterlockedCompareExchange@12
    MSVCRT.lib(gs_report.obj) : error LNK2001: symbole externe non résolu __imp__TerminateProcess@8
    MSVCRT.lib(gs_report.obj) : error LNK2001: symbole externe non résolu __imp__GetCurrentProcess@0
    MSVCRT.lib(gs_report.obj) : error LNK2001: symbole externe non résolu __imp__UnhandledExceptionFilter@4
    MSVCRT.lib(gs_report.obj) : error LNK2001: symbole externe non résolu __imp__SetUnhandledExceptionFilter@4
    MSVCRT.lib(gs_report.obj) : error LNK2001: symbole externe non résolu __imp__IsDebuggerPresent@0
    MSVCRT.lib(dllmain.obj) : error LNK2001: symbole externe non résolu __imp__DisableThreadLibraryCalls@4
    MSVCRT.lib(gs_support.obj) : error LNK2001: symbole externe non résolu __imp__QueryPerformanceCounter@4
    MSVCRT.lib(gs_support.obj) : error LNK2001: symbole externe non résolu __imp__GetTickCount@0
    MSVCRT.lib(gs_support.obj) : error LNK2001: symbole externe non résolu __imp__GetCurrentThreadId@0
    MSVCRT.lib(gs_support.obj) : error LNK2001: symbole externe non résolu __imp__GetCurrentProcessId@0
    MSVCRT.lib(gs_support.obj) : error LNK2001: symbole externe non résolu __imp__GetSystemTimeAsFileTime@4
    build\lib.win-amd64-3.6\rtmidi_rtmidi.cp36-win_amd64.pyd : fatal error LNK1120: 103 externes non résolus
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe' failed with exit status 1120

Thanks you very much .

@patrickkidd
Copy link
Owner

C++ python packages are hard to support, but these are linker errors so they should be somewhat straightforward if you understand how the C++ linker works. I will work with you if you can provide a patch.

I use python 3.5.2 on both windows and mac, but I don't think that the micro version number will matter for linker errors so long as you have the right libraries listed as you have done in setup.py.

@guilbut
Copy link
Author

guilbut commented Sep 22, 2017

Hi Patrick,

I finally succeed to compile PyRtMidi for python 2.7-64bit , python 3.6-32bit and python 3.6-64bit !

For each version of python I have to modify the PATH environment variables :

python 2.7-64bit :
PATH = %USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64;%USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin\x64

python 3.6-32bit :
PATH = %PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:/Program Files (x86)/Windows Kits/10/bin/10.0.15063.0/x86

python 3.6-64bit :
PATH = %PATH%C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:/Program Files (x86)/Windows Kits/10/bin/10.0.15063.0/x64

And I modified the setup.py.
I don't know how to propose a patch, and I'm not sure that my new code is the good way to do (lot of hard coded paths), so i paste the new setup.py here
setup.txt

Thanks !

@MikeTheWatchGuy
Copy link

MikeTheWatchGuy commented Jan 14, 2018

I think I'm having a similar problem. This is the tail of the error I get upon trying pip install rtmidi.

I need rtmidi for another package I installed called mido.

I'm running Python 3.6 on Windows 10 64 bit.

The path given above , in the altered setup doesn't exist on my system. Any help is more than a little appreciated!


LINK : fatal error LNK1181: cannot open input file 'python34.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\link.exe' failed with exit status 1181

----------------------------------------

Command "C:\Python\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\mike\AppData\Local\Temp\pip-build-43rn3708\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 C:\Users\mike\AppData\Local\Temp\pip-r6ff6gs0-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\mike\AppData\Local\Temp\pip-build-43rn3708\rtmidi\

@MikeTheWatchGuy
Copy link

I renamed one of my python36.lib files python34.lib, copied it to a location on my path and everything installed this time. Mido crashes with a problem, but I don't think it's due to this install.

@patrickkidd
Copy link
Owner

patrickkidd commented Jan 15, 2018 via email

@MikeTheWatchGuy
Copy link

Thank you very much Patrick for the quick and thoughtful reply.

Sounds like pyrtmidi isn't a fit for my project. That also rules out several other packages that are built on pyrtmidi.

I read somewhere PyGame has a good MIDI module. I was able to get the PyGame MIDI module to tell me about my in/out midi devices.

I was hoping to use something that had a higher level API, but maybe I should stick with PyGame and write my own MIDI file parser?

What would you recommend? I trust you know this space well.

This code worked for me:


import pygame.midi as midi

c = midi.init()
count = midi.get_count()
in_id = midi.get_default_input_id()
out_id = midi.get_default_output_id()
out_info = midi.get_device_info(out_id)
in_info = midi.get_device_info(in_id)

sprint(f'There are {count} MIDI devices', 'in, out ids:',in_id, out_id, f'output info =', out_info, f'Input info is', in_info)

sprint is my own GUI print routine outputs to a scrolling window instead of command line.

It produced this output:

There are 5 MIDI devices
in, oud ids:
1
0
output info =
(b'MMSystem', b'Microsoft MIDI Mapper', 0, 1, 0)
Input info is
(b'MMSystem', b'USB2.0-MIDI', 1, 0, 0)

@patrickkidd
Copy link
Owner

patrickkidd commented Jan 15, 2018 via email

@MikeTheWatchGuy
Copy link

Oh, I would love to use it. I can't get it installed in my 3.6 environment. That makes it, well, completely unusable and thus not a fit for my project. It looks technically great and several other modules take it up even further.

@patrickkidd
Copy link
Owner

patrickkidd commented Jan 15, 2018 via email

@guilbut
Copy link
Author

guilbut commented Jan 21, 2018

Hi Pattrick and Mike !
I just made a pull request to update setup.py for a compilation on Windows.
As soon as pattrrick has accepted the pull request, Mike could try to :

  1. download Visual Studio Community 2017 on https://www.visualstudio.com/downloads
  2. install it with "Python development workload and the Native development tools" cheked (important! )
  3. pip install rtmidi
  4. rename if needed python-3.X.X\Lib\site-packages\rtmidi_rtmidi.XXX.pyd into _rtmidi.pyd
    If it still doesn't work i can send my _rtmidi.pyd file compiled for python 3.6

For Pattrick curiosity, I'm developing a software which allows musicians to control their audio effects with the face, an infrared camera to allow to use it on stage, and especially for guitarists a analogical wah-wah pedal controlable with mouth (with a small computer inside, a touch screen and midi in/out for control other pedals with the face) for an all-in-one solution. You can have a look here:

http://www.smartaudiotools.com/

For now I heavily use Python and PyQt for the user interface and glue the C++ components for face recognition and camera acquisition.

@MikeTheWatchGuy
Copy link

I'm using mido which requires an rtmidi module. That is how I ended up here with this question.

When I contacted the mido folks, they suggested I pip install python-rtmidi
I did and my problems went away. I assume that's not the same rtmidi as this one.

At this point I don't think I need help until or unless I change the modules I'm using. Thank you for the support however! It's very appreciated!

@himijendrix24
Copy link

himijendrix24 commented Jul 24, 2018

I had similar issues (also with python mido). This solved the issuse (on ubuntu):
sudo apt-get install libasound2-dev
sudo apt-get install libjack-dev

@bergamote
Copy link

bergamote commented Oct 19, 2020

For what it's worth, my program micronux uses pyrtmidi and on linux it indeed needed libasound2-dev to pip install succesfully (and also needs wheel, obvs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants