Mac mpf-mc Install Problem - Help please!

216 views
Skip to first unread message

Davey

unread,
Aug 27, 2018, 4:03:18 AM8/27/18
to MPF Users
Hey,

Struggling to get mpf-mc installed on my mac. Initially caused my having 
Python 3.7 installed, I was able to get around that part by installing 3.6 
and then running the install using:

python3.6 -m pip install mpf-mc

This results in having an issue finding the include SDL.h.

/private/var/folders/tp/2tf55xqx1nz_c64bcwyj0y080000gn/T/pip-install-85odolj3/mpf-mc/mpfmc/core/audio/sound_file.c:524:10: fatal error: 'SDL.h' file not found

    #include "SDL.h"

             ^~~~~~~

    1 error generated.

    error: command 'gcc' failed with exit status 1


Other things I've tried:

brew install sdl

brew install sdl sdl_image sdl_mixer sdl_ttf portmidibrew install sdl2

brew link sdl

brew link sdl2

pip3 install setuptools --upgrade


Any help would be much appreciated!




Davey

unread,
Aug 27, 2018, 4:05:09 AM8/27/18
to MPF Users
I should also note that I've following the Mac installer instructions (a number of times) here:

And install all the SDL frameworks into /Library/Framerworks

Anthony van Winkle

unread,
Aug 28, 2018, 9:31:15 PM8/28/18
to MPF Users
I remember encountering this issue before, but I can't say for certain how I solved it.

My first guess would be installing SDL directly from https://www.libsdl.org/download-2.0.php, choosing the Development library.

A search of my machine reveals two versions of SDL.h in  `/Library/Frameworks/SDL.framework/Versions/A/Headers/SDL.h` and  `/Library/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h`

I'm not sure if the fact I'm using virtual environments instead of explicit python versioning makes any difference, but maybe that could get you in the right direction?

Davey

unread,
Aug 29, 2018, 3:24:45 AM8/29/18
to MPF Users
Finally got this working.

For some reason a lot of the SDL2 frameworks (SDL2_mixer, SDL2_image, GStreamer) didn't exist in the Frameworks folder, so when I redownloaded those from the installer docs, everything started working again.

Thanks the help! 

Davey

unread,
Aug 29, 2018, 8:35:41 AM8/29/18
to MPF Users
Anthony - if you wouldn't mind checking something for me please?

I'm now able to run one of the example games (yay) however the main MPF window is throwing some library warnings:

SDL2 is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /Library/Frameworks/SDL2.framework/Versions/A/SDL2. One of the two will be used. Which one is undefined.

This is due to kivy having a number of duplicated dynamic libraries in the /.dylib folder. Would you be able to check you kivy install to see A) if it's in the same location as mind and B) if the SDL2 executable library exists on that folder?

Many thanks


On Wednesday, 29 August 2018 02:31:15 UTC+1, Anthony van Winkle wrote:

Peter Hauer

unread,
Nov 4, 2018, 1:25:19 PM11/4/18
to MPF Users
Hi,

I have my pinball back and I am now in the process of updating my mac installations to the latest MPF.
While updating I now encounter exactly the same problem, after updating Kivy to 1.10.1.
Did you found a fix or workaround for this behavior?

If you found a solution it would be nice, if you can write a follow up here.

Thanks, Peter.

jabdoa

unread,
Nov 4, 2018, 3:17:34 PM11/4/18
to MPF Users
I'm not on a mac. Does this way work? https://kivy.org/doc/stable/installation/installation-osx.html#using-homebrew-with-pip. If not we can address this with the kivy dev team.


Jan

Peter Hauer

unread,
Nov 5, 2018, 2:21:34 PM11/5/18
to MPF Users
Hi Jan,

I tried building Kiwi without brew and followed the instructions to download the frameworks by hand, but then I get the dev version of Kivy which MPF then tells me that the requirements are not fulfilled. So at the moment I don't have a solution to this problem. It is quite annoying, because I can't see the Information in the main MPF window because of the error messages that appear.

I am out of time today, will continue to try and find a solution tomorrow.

Yours, Peter.  

Peter Hauer

unread,
Nov 5, 2018, 4:28:54 PM11/5/18
to MPF Users
Hello,

so I had to try it some more and I have now found a workaround which is quite obvious, but I was so focused on playing around with the Kivy Installation and the frameworks, that I did not thought about the easy way.

I can just simply start two terminal sessions and start mpf and mpf mc independently.
This does not solve the problem completely, but the warning then appears only in the terminal that launched mpf mc and not in the main window. mpf both is a bit more comfortable, but I don't get that problem with the frameworks solved at the moment.

Yours, Peter.

jabdoa

unread,
Nov 5, 2018, 6:20:41 PM11/5/18
to MPF Users
Hi Peter,

1. Can you post the complete output of your install?
2. Why do you think that the kivy installer gives you the dev version? https://pypi.org/project/Kivy/ is version 1.10.1 which is what we want. Can you post the output?
3. I don't understand why running "mpf game" and "mpf mc" works around your problem. Can you explain?


Jan

jabdoa

unread,
Nov 5, 2018, 7:09:19 PM11/5/18
to MPF Users
I tried it on travis. Looks like mpf-mc installs fine if you just run "brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer" and "pip install Cython==0.26.1". See: https://travis-ci.org/missionpinball/mpf-mc/jobs/451139223. Maybe you need to uninstall the downloaded "framework.zip" before?

Jan

Peter Hauer

unread,
Nov 6, 2018, 6:31:34 AM11/6/18
to MPF Users
Hi,

thanks for the test and the reply. I will try the installation again, but will have to clean my installation. Perhaps something goes wrong because of the old files on my mac.

I have attached you a screenshot of the problem. The output of mpf mc goes into the main window, so that I can't read the information. If I start separately, then the output from mc goes into it's own terminal. Normally I would expect the warnings to be piped into the log file, but in this case that did not happen somehow.

Yours, Peter. 
Bildschirmfoto 2018-11-06 um 12.26.14.png

Peter Hauer

unread,
Nov 6, 2018, 7:49:11 AM11/6/18
to MPF Users
Just spend lunch uninstalling everything and starting new installation.
So the problem is still there for me. If I delete the frameworks before I brew like you explained, then afterwards mpf-mc still has a dependency while loading and gives me this error:

kivy: Factory: 194 symbols loaded

kivy: Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)

kivy: VideoGstplayer: Using Gstreamer 1.10.4.0

kivy: Video: Provider: gstplayer

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/mpf", line 11, in <module>

    sys.exit(run_from_command_line())

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpf/commands/__init__.py", line 176, in run_from_command_line

    CommandLineUtility(path).execute()

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpf/commands/__init__.py", line 152, in execute

    *self.parse_args())

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpfmc/commands/mc.py", line 200, in __init__

    from mpfmc.core.mc import MpfMc

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpfmc/core/mc.py", line 41, in <module>

    from mpfmc.assets.bitmap_font import BitmapFontAsset

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpfmc/assets/bitmap_font.py", line 3, in <module>

    from mpfmc.uix.bitmap_font.bitmap_font import BitmapFont

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpfmc/uix/bitmap_font/bitmap_font.cpython-36m-darwin.so, 2): Library not loaded: /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/GStreamer

  Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mpfmc/uix/bitmap_font/bitmap_font.cpython-36m-darwin.so

  Reason: image not found


Did I have to make the brewed gstreamer instance known to python myself somehow? 


Am Dienstag, 6. November 2018 01:09:19 UTC+1 schrieb jabdoa:

Peter Hauer

unread,
Nov 6, 2018, 8:18:05 AM11/6/18
to MPF Users
Hi Jan,

I have tried it now on my Windows7 machine and there I also get some warnings with gstreamer, so perhaps my original installation does influence with the update. I was on a 0.50 dev version before. The warnings on the windows machine are annoying, too because you have to confirm then when mc starts every time. So the Kivy-Update messes my installations up a bit I would say.

When I installed Kivy from scratch I got 1.11.x that is how I saw that. Just to answer your question from before.

F:\PinballMachines\mpf-examples-dev_0.51\mpf-examples-dev\demo_man>mpf both -X
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libass-9.dll': 'c:\python36\share\gstreamer\bin\libass-9.dll': D
ie angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libgstassrender.dll': 'c:\python36\share\gstreamer\bin\libgstass
render.dll': Die angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libgstpango.dll': 'c:\python36\share\gstreamer\bin\libgstpango.d
ll': Die angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libgstrsvg.dll': 'c:\python36\share\gstreamer\bin\libgstrsvg.dll
': Die angegebene Prozedur wurde nicht gefunden.
WARNING: no real random source present!
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libharfbuzz-0.dll': 'c:\python36\share\gstreamer\bin\libharfbuzz
-0.dll': Die angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libpangocairo-1.0-0.dll': 'c:\python36\share\gstreamer\bin\libpa
ngocairo-1.0-0.dll': Die angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\libpangoft2-1.0-0.dll': 'c:\python36\share\gstreamer\bin\libpang
oft2-1.0-0.dll': Die angegebene Prozedur wurde nicht gefunden.
(python.exe:6964): GStreamer-WARNING **: Failed to load plugin 'c:\python36\shar
e\gstreamer\bin\librsvg-2-2.dll': 'c:\python36\share\gstreamer\bin\librsvg-2-2.d
ll': Die angegebene Prozedur wurde nicht gefunden.
Stopped.
Event: ======'mode_service_stopped'====== Args={}
Event: ======'clear'====== Args={'key': 'service'}
MPF run loop ended.
F:\PinballMachines\mpf-examples-dev_0.51\mpf-examples-dev\demo_man>

Peter Hauer

unread,
Nov 6, 2018, 12:15:49 PM11/6/18
to MPF Users
I just got back and found the solution for the windows-problem:
libfreetype-6.dll is provided in share/gstreamer and share/sdl2 and in my case after the installation of kivy in my opinion it took the dll from the sdl2 path, where the additional dlls could not be found. after deleting the lib from the share/sdl2 path now everything works fine, as in my opinion now the dll in the gstreamer folder is used. So under windows7 I am up and running again. 

Now let's see if I can find the problem with the Mac-Installation. 

Peter Hauer

unread,
Nov 6, 2018, 1:33:20 PM11/6/18
to MPF Users
LOL!

I rebuild it like you did on Travis, but then I now got it the other way around.

kivy: VideoGstplayer: Using Gstreamer 1.10.4.0
kivy: Video: Provider: gstplayer
objc[18501]: Class SDLApplication is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLAppDelegate is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLTranslatorResponder is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLMessageBoxPresenter is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLOpenGLContext is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLWindow is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class Cocoa_WindowListener is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[18501]: Class SDLView is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
kivy: Loading MPF-MC controller

This is really frustrating. I got rid of the Gstreamer dependencies, but now I have got the SDL2 doubled. I think I will have to start over again with building that, perhaps I made a mistake somewhere.

Am Dienstag, 6. November 2018 01:09:19 UTC+1 schrieb jabdoa:

Peter Hauer

unread,
Nov 7, 2018, 2:59:21 AM11/7/18
to MPF Users
I restarted before breakfast. Got the same problem. Here is what I did:

1. sudo installer -pkg python-3.6.7-macosx10.6.pkg -target /
2. curl -sS https://bootstrap.pypa.io/get-pip.py > get-pip.py
3. sudo python3 get-pip.py
4. pip3 install setuptools Cython==0.26.1 --upgrade
5. brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
6. git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf
7. pip3 install -e _mpf/
8. git clone --depth=50 --branch=update_mac_python_version https://github.com/missionpinball/mpf-mc.git missionpinball/mpf-mc
9. cd missionpinball/mpf-mc
10. git checkout -qf 734ad3d4bb8d1204dbd5f643275ed2985e79ad00
11. pip3 install .


Messages in mpf-mc: 
kivy: Factory: 194 symbols loaded
kivy: Image: Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
kivy: VideoGstplayer: Using Gstreamer 1.10.4.0
kivy: Video: Provider: gstplayer
objc[1702]: Class SDLApplication is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLAppDelegate is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLTranslatorResponder is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLMessageBoxPresenter is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLOpenGLContext is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLWindow is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class Cocoa_WindowListener is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
objc[1702]: Class SDLView is implemented in both /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/.dylibs/SDL2 and /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib. One of the two will be used. Which one is undefined.
kivy: Loading MPF-MC controller
mpfmc: Mission Pinball Framework Media Controller v0.51.0-dev.3
mpfmc: Mission Pinball Framework Game Engine v0.51.0-dev.16

Perhaps on Travis you did not see this, because the installation is up and running, it is just the mpf main window that get's overwritten. So this behavior will not appear in the log-file.

Thanks, Peter.

jabdoa

unread,
Nov 7, 2018, 10:57:55 AM11/7/18
to MPF Users
Ah ok I understand the issue now. Thanks for debugging this further. We need to check with the kivy devs if this is a known problem. Does it work nonetheless? Or do you see any problems in mc (besides disturbing the mpf text ui)?

Peter Hauer

unread,
Nov 8, 2018, 7:12:35 AM11/8/18
to MPF Users
Hi,
I don't have any problems with mpf in this configuration. Haven't tested with my machine, but the development on mac works like normal.
I also found another workaround. If I use "mpf both -X" after the text appears in the UI of mpf, I can simply resize the window of mpf and it redraws itself. As this messages only appear at the start of mc this is a good workaround for me.

So perhaps we can implement that into mpf, so that a short time after mc is started it refreshes the ui once. Or we must see why the text output does not go into the log where it in my opinion should land.

That the frameworks exists double in system does not have another effect in my opinion. If I am the only one to experience this behavior or perhaps I am the only one using mac then just keep it like it is now, I can life with that now, that I have got a workaround.

Thanks for your help, again.

jabdoa

unread,
Nov 8, 2018, 1:16:50 PM11/8/18
to MPF Users
We can probably somehow suppress the log messages I guess. Have to look into it.


Jan

Reply all
Reply to author
Forward
0 new messages