MPF crashing at startup

124 views
Skip to first unread message

leeoneil

unread,
Oct 14, 2023, 7:42:41 AM10/14/23
to MPF Users
Hello everybody,
i have a strange issue with MPF.

I was running with 0.55, everything was working.
Today I started having some crash launching a game, but not due to my file.

So I tried to install the 0.56.
I've uninstall everything, repaired python, and nox it's impossible to launch mpf.

With mpf --version it says 0.52.2
Python is 3.9.13

When I launch mpf, i have this message :

Failed to initialise MPF
Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\machine.py", line 679, in initialise_mpf
    raise init.exception()
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\machine.py", line 246, in initialise
    await self.initialise_core_and_hardware()
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\machine.py", line 232, in initialise_core_and_hardware
    self._load_hardware_platforms()
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\machine.py", line 479, in _load_hardware_platforms
    self.add_platform(hardware_platform)
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\machine.py", line 592, in add_platform
    hardware_platform = Util.string_to_class(self.config['mpf']['platforms'][name])
  File "C:\Program Files\Python39\lib\site-packages\mpf\core\utility_functions.py", line 615, in string_to_class
    m = __import__(module)
  File "C:\Program Files\Python39\lib\site-packages\mpf\platforms\opp\opp.py", line 14, in <module>
    from mpf.platforms.base_serial_communicator import HEX_FORMAT
  File "C:\Program Files\Python39\lib\site-packages\mpf\platforms\base_serial_communicator.py", line 5, in <module>
    from serial import SerialException, EIGHTBITS, PARITY_NONE, STOPBITS_ONE
ImportError: cannot import name 'SerialException' from 'serial' (C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\serial\__init__.py)


Does somenone already have this kind of problem ?
thank's !

Johan Gill

unread,
Oct 14, 2023, 8:55:28 AM10/14/23
to mpf-...@googlegroups.com
If mpf says it's 0.52.2 it probably isn't running 0.56.

Does it work if you run with -x? I'm no expert but serial_exception sounds like it's problem to access your hardware, just guessing. :/

I would try (for troubleshooting) make a new profile in Windows and install everything again and try. A new profile is like starting fresh. If you run Linux I'm not completely sure how to proceed.

Cheers.

/Gill

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/eb1b5d1c-2f8e-4aff-a23a-908845469320n%40googlegroups.com.

Avery Tummons

unread,
Oct 14, 2023, 9:49:21 AM10/14/23
to mpf-...@googlegroups.com
I would uninstall and reinstall MPF. If you do standard install you will get 0.56.2 (I think, subversion could be higher). 0.52 didn’t support python 3.9, which is why it won’t work.
Sent from my iPhone

On Oct 14, 2023, at 7:55 AM, Johan Gill <jo...@gill.nu> wrote:



leeoneil

unread,
Oct 14, 2023, 9:57:07 AM10/14/23
to MPF Users
thank's ! So I reinstall totally windows, and begin again the installation for MPF (much easier now thaht I remenber).
But now mpf MC not working... Seems that mpf running (but impossible to test switches). (waiting for media controller)

MPF 0.56.2 not 0.52 sorry !

Johan Gill

unread,
Oct 14, 2023, 10:00:13 AM10/14/23
to mpf-...@googlegroups.com
You really don't have to reinstall Windows. Just create a new profile if you want to start fresh.

/Gill

leeoneil

unread,
Oct 14, 2023, 10:05:25 AM10/14/23
to MPF Users
Ok thank's it was the brutal way....

So a problem of exception as you said... If I launch mpf mc alone, i have this :

kivy: DLL load failed while importing audio_interface: Le module spécifié est introuvable.

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\commands\mc.py", line 225, in __init__
    MpfMc(options=vars(args),
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\mc.py", line 151, in __init__
    create_config_collections(self, self.machine_config['mpf-mc']['config_collections'])
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\config_collection.py", line 82, in create_config_collections
    imported_module = import_module(module)
  File "C:\Program Files\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\config_collections\sound_loop_set.py", line 1, in <module>
    from mpfmc.core.audio.audio_exception import AudioException
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\audio\__init__.py", line 7, in <module>
    from mpfmc.core.audio.audio_interface import AudioInterface
ImportError: DLL load failed while importing audio_interface: Le module spécifié est introuvable.
kivy: Stopping child threads... (0 remaining)
kivy: All child threads stopped.

Avery Tummons

unread,
Oct 14, 2023, 11:47:20 AM10/14/23
to mpf-...@googlegroups.com
Can you post pip list command output?
Sent from my iPhone

On Oct 14, 2023, at 9:05 AM, leeoneil <l...@rdtp.net> wrote:

Ok thank's it was the brutal way....

leeoneil

unread,
Oct 14, 2023, 12:47:51 PM10/14/23
to MPF Users
Hello !
Not sure what I can provide you.

The entire message is this one when launching MPF MC :

kivy: Factory: 189 symbols loaded
kivy: ImageLoaderFFPy: Using ffpyplayer 4.3.5
kivy: Image: Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
kivy: VideoFFPy: Using ffpyplayer 4.3.5
kivy: Video: Provider: ffpyplayer(['video_ffmpeg'] ignored)
kivy: mpfmc.core.audio library could not be loaded. Audio features will not be available
kivy: Loading MPF-MC controller
YamlMultifileConfigLoader: Machine config file #1: config
ConfigProcessor: Config file in cache changed: C:\pinball\cthulhu\config\config
ConfigProcessor: Loading config from file C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\mcconfig.yaml.
ConfigProcessor: Loading config: C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\mcconfig.yaml
ConfigProcessor: Loading config from file C:\pinball\cthulhu\config\config.
ConfigProcessor: Loading config: C:\pinball\cthulhu\config\config
ConfigProcessor: Loading config: C:\pinball\cthulhu\config\sounds_config.yaml
ConfigProcessor: Loading config: C:\pinball\cthulhu\config\lights_config.yaml
ConfigProcessor: Config file cache created: C:\Users\Admin\AppData\Local\Temp\3c3620f941ef77f148c9e6615584b76d.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\Admin\AppData\Local\Temp\31e67a646edff32b4d47481cf60822eb.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\Admin\AppData\Local\Temp\f529aea1ba5fd1929d8f9183ce2047ff.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\Admin\AppData\Local\Temp\749c49c8d443b4271fc7847e48caedf3.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\Admin\AppData\Local\Temp\d9b9dec214c6e29ed4ca335c867d84f1.mpf_cache
mpfmc: Mission Pinball Framework Media Controller v0.56.1
mpfmc: Mission Pinball Framework Game Engine v0.56.2
mpfmc: Machine path: C:\pinball\cthulhu
mpfmc: Starting clock at 60.0Hz
kivy: Text: Provider: sdl2

kivy: DLL load failed while importing audio_interface: Le module spécifié est introuvable.
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\commands\mc.py", line 225, in __init__
    MpfMc(options=vars(args),
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\mc.py", line 151, in __init__
    create_config_collections(self, self.machine_config['mpf-mc']['config_collections'])
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\config_collection.py", line 82, in create_config_collections
    imported_module = import_module(module)
  File "C:\Program Files\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\config_collections\sound_loop_set.py", line 1, in <module>
    from mpfmc.core.audio.audio_exception import AudioException
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\mpfmc\core\audio\__init__.py", line 7, in <module>
    from mpfmc.core.audio.audio_interface import AudioInterface
ImportError: DLL load failed while importing audio_interface: Le module spécifié est introuvable.
kivy: Stopping child threads... (0 remaining)
kivy: All child threads stopped.

Johan Gill

unread,
Oct 14, 2023, 12:52:49 PM10/14/23
to mpf-...@googlegroups.com
I guess it's this problem...


Have it as well on new installation.

/Gill

leeoneil

unread,
Oct 14, 2023, 1:13:53 PM10/14/23
to MPF Users
Ok, thank's !
If I follow the links correctly it's supposed to be solved.
So I tried installing the MPF 0.57 but I have no luck with it... 

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mpf-mc 0.56.1 requires psutil==5.9.4, but you have psutil 5.9.5 which is incompatible.
mpf-mc 0.56.1 requires ruamel.yaml==0.15.42, but you have ruamel-yaml 0.17.32 which is incompatible.

Gosh... impossible to run, even starting from a fresh computer... I'm lost...

Avery Tummons

unread,
Oct 14, 2023, 1:25:57 PM10/14/23
to mpf-...@googlegroups.com
Uninstall MPF. When you type pip list in command prompt you should see a couple things only (no mpf, etc.).

Then reinstall mpf and mc. Then if it still doesn’t work please run pip list in command prompt and post the results.

Sent from my iPhone

On Oct 14, 2023, at 12:13 PM, leeoneil <l...@rdtp.net> wrote:

Ok, thank's !

leeoneil

unread,
Oct 14, 2023, 1:39:37 PM10/14/23
to MPF Users
Uninstalling and installing, I tried twice totally (reinstalling windows too);;;
here is the pip list.
thank's for helping !

Package             Version
------------------- ----------
asciimatics         1.12.0
certifi             2023.7.22
charset-normalizer  3.3.0
click               8.1.7
colorama            0.4.6
docutils            0.20.1
ffpyplayer          4.3.5
future              0.18.3
idna                3.4
Kivy                2.1.0
kivy-deps.angle     0.3.3
kivy-deps.glew      0.3.1
kivy-deps.gstreamer 0.3.3
kivy-deps.sdl2      0.4.5
Kivy-Garden         0.1.5
mpf                 0.56.2
mpf-mc              0.56.1
mpf-monitor         0.56.1
packaging           23.1
Pillow              10.0.1
pip                 23.2.1
prompt-toolkit      3.0.33
psutil              5.9.4
pyfiglet            1.0.2
Pygments            2.14.0
pypiwin32           223
PyQt5               5.15.9
pyqt5-plugins       5.15.9.2.3
PyQt5-Qt5           5.15.2
PyQt5-sip           12.13.0
pyqt5-tools         5.15.9.3.3
PyQt6               6.4.2
PyQt6-Qt6           6.5.3
PyQt6-sip           13.6.0
pyserial            3.5
pyserial-asyncio    0.4
python-dotenv       1.0.0
pywin32             306
qt5-applications    5.15.2.2.3
qt5-tools           5.15.2.1.3
requests            2.31.0
ruamel.yaml         0.15.42
ruamel.yaml.clib    0.2.8
setuptools          58.1.0
sortedcontainers    2.3.0
terminaltables      3.1.0
urllib3             2.0.6
wcwidth             0.2.8

leeoneil

unread,
Oct 14, 2023, 3:12:52 PM10/14/23
to MPF Users
Trying uninstalling and reinstalling kivy audio dependencies give me this :

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
kivy 2.1.0 requires kivy-deps.sdl2~=0.4.5; sys_platform == "win32", but you have kivy-deps-sdl2 0.6.0 which is incompatible.
mpf-mc 0.56.1 requires kivy-deps.sdl2==0.4.5; platform_system == "Windows", but you have kivy-deps-sdl2 0.6.0 which is incompatible.
mpf-mc 0.56.1 requires Pygments==2.14.0, but you have pygments 2.16.1 which is incompatible.

Can it help ?

Ernie Silverberg

unread,
Oct 14, 2023, 3:14:44 PM10/14/23
to mpf-...@googlegroups.com
Run pip install rumael.yaml==0.17.32 —force and same for psutil 

leeoneil

unread,
Oct 14, 2023, 4:11:54 PM10/14/23
to MPF Users
Thank's, I tried for rumael but the installation give this error message :
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mpf-mc 0.56.1 requires ruamel.yaml==0.15.42, but you have ruamel-yaml 0.17.32 which is incompatible.
mpf 0.56.2 requires ruamel.yaml==0.15.42, but you have ruamel-yaml 0.17.32 which is incompatible.
Successfully installed ruamel.yaml-0.17.32

Anyway it's installed, but mpf mc does not launch anymore.

I tried pip install psutil but wich version do I need ?

leeoneil

unread,
Oct 14, 2023, 4:33:42 PM10/14/23
to MPF Users
I managed to install 0.57.0.dev21
I installed the ruamel.yaml 0.15.32

and it's still not working.
MPf -x launch, but same error with MPF MC (I installed the last version,, and mpf-monitor on the last version)
Gosh.....
Crazy....

Anthony van Winkle

unread,
Oct 14, 2023, 4:52:46 PM10/14/23
to MPF Users
Moving between MPF versions can be particularly fraught without the use of virtual environments, which isolate your entire python setup (including pip and all packages). What you're experiencing now is versions of packages installed by different versions of mpf/mc not always being accepted by other versions.

I once wrote a tutorial on setting up virtual environments for MPF, but that was a few generations ago and with all the refactoring of the platform over the last year, it's no longer there. I'll start rewriting it for the 0.56+ editions, but in the meantime you can google how to setup a python virtual environment and I suggest doing that. When you have a fresh virtual environment, existing packages won't impact because only those in the virtual environment will be used.

All that being said, the audio interface issue was also found on 0.57 and fixed with a workaround for windows. I've created a new pull request to backport this functionality to 0.56: https://github.com/missionpinball/mpf-mc/pull/453

leeoneil

unread,
Oct 14, 2023, 6:40:39 PM10/14/23
to MPF Users
SOLVED !!!!!!

So I formated c:/, new install of win 10 64.
I started with python 3.11 and the last version of MPF, MPF MC and MPF Monitor (0.57)
I made the changes in my files, and it's starting again (at least the attrack mode, need to test further for the other mode).

thank's everyone with your help, i was going crazy !
Thank's to all the developmment team of MPF, I hope I can pay you a beer one day, your work is amazing !

Just for information I had the same problem with openGL, problem solved here : (7) Kivy fatal error or openGL not detect problem - YouTube
Reply all
Reply to author
Forward
0 new messages