Need help installing MPF

320 views
Skip to first unread message

Flying (Dutchman)

unread,
Oct 20, 2022, 3:37:39 PM10/20/22
to MPF Users
Hi all,

I have the proud owner of Cobrapin board for over 6 months now and I have been trying for weeks to install mpf succesfully but I keep bumping into different errors even when trying to install on different machines.

When using:
pip install --user pipx

I get:
  WARNING: The script userpath.exe is installed in 'C:\Users\name\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script pipx.exe is installed in 'C:\Users\name\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed argcomplete-2.0.0 click-8.1.3 colorama-0.4.5 packaging-21.3 pipx-1.1.0 pyparsing-3.0.9 userpath-1.8.0

I have tried deleting Python and reinstalling Python in different versions for multiple times but without any succes.

Would someone be willing to help me out (Via teamviewer?)?

Thanks in advance.

Regards,

René

Johan Gill

unread,
Oct 20, 2022, 3:45:24 PM10/20/22
to mpf-...@googlegroups.com
Do you add a path in setup when installing python? I think you can do a repair on your python installation and choose add to path, it's a checkbox.

You can also do it manually. 


Do you have some old.python version installed since before?


/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/4615892d-827a-455d-a318-5df4d679911an%40googlegroups.com.

Flying (Dutchman)

unread,
Oct 20, 2022, 4:08:12 PM10/20/22
to MPF Users
Thnx for the quick reply

I deleted Python again and reinstalled the newest version 3.10.8 (not in the manual is this ok?)

I made sure to tick the box ''Add to Python PATH''

And restarted the tutotial:

C:\Users\reneh>pip install --user pipx
Requirement already satisfied: pipx in c:\users\reneh\appdata\roaming\python\python310\site-packages (1.1.0)
Requirement already satisfied: argcomplete>=1.9.4 in c:\users\reneh\appdata\roaming\python\python310\site-packages (from pipx) (2.0.0)
Requirement already satisfied: userpath>=1.6.0 in c:\users\reneh\appdata\roaming\python\python310\site-packages (from pipx) (1.8.0)
Requirement already satisfied: packaging>=20.0 in c:\users\reneh\appdata\roaming\python\python310\site-packages (from pipx) (21.3)
Requirement already satisfied: colorama>=0.4.4 in c:\users\reneh\appdata\roaming\python\python310\site-packages (from pipx) (0.4.5)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\reneh\appdata\roaming\python\python310\site-packages (from packaging>=20.0->pipx) (3.0.9)
Requirement already satisfied: click in c:\users\reneh\appdata\roaming\python\python310\site-packages (from userpath>=1.6.0->pipx) (8.1.3)

C:\Users\reneh>python -m pipx ensurepath
C:\Users\reneh\AppData\Roaming\Python\Python310\Scripts is already in PATH.
C:\Users\reneh\.local\bin is already in PATH.

⚠️  All pipx binary directories have been added to PATH. If you are sure you want to proceed, try again with the
'--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨

Does this mean there are still some old python version installed somewhere?

I deleted the python folder in Program Files..

In C:\Users\reneh\AppData\Roaming\Python i found tree folders: 
 - Python 37
- Python 39
 - Python 310

I deleted 37 & 39.

Then continud the tutorial:

C:\Users\reneh>pipx install "mpf[cli]" --pip-args="--pre" --verbose --include-deps
pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is 'C:\\Users\\reneh\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
pipx >(package_name_from_spec:323): Determined package name: mpf
pipx >(package_name_from_spec:324): Package name determined in 0.0s
'mpf' already seems to be installed. Not modifying existing installation in
'C:\\Users\\reneh\\.local\\pipx\\venvs\\mpf'. Pass '--force' to force installation.

C:\Users\reneh>pipx inject mpf mpf-mc --pip-args="--pre" --verbose --include-deps --include-apps
pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is 'C:\\Users\\reneh\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
pipx >(run_pipx_command:169): Virtual Environment location is C:\Users\reneh\.local\pipx\venvs\mpf
Can't inject 'mpf-mc' into Virtual Environment 'mpf'. 'mpf' has missing internal pipx metadata. It was likely
installed using a pipx version before 0.15.0.0. Please uninstall and install 'mpf', or reinstall-all to fix.


Does this mean i still have an older pipx version? Im know how to uninstall mpf...

Thnx

Op donderdag 20 oktober 2022 om 21:45:24 UTC+2 schreef jo...@gill.nu:

Flying (Dutchman)

unread,
Oct 20, 2022, 4:10:14 PM10/20/22
to MPF Users
Additionaly: 
C:\Users\reneh>mpf --version
'mpf' is not recognized as an internal or external command,
operable program or batch file.


Op donderdag 20 oktober 2022 om 22:08:12 UTC+2 schreef Flying:

Johan Gill

unread,
Oct 20, 2022, 4:11:51 PM10/20/22
to mpf-...@googlegroups.com
You need 3.9. 3.10 isn't supported. But yeah, that checkbox is correct.

/Gill

Flying (Dutchman)

unread,
Oct 20, 2022, 4:31:30 PM10/20/22
to MPF Users
Deleted 3.10 and installed 3.9.13 with the PATH box ticked.

It seemed to work better, but then i got:
C:\Users\reneh>pipx install "mpf[cli]" --pip-args="--pre" --verbose --include-deps
Fatal error in launcher: Unable to create process using '"C:\Users\reneh\AppData\Local\Programs\Python\Python310\python.exe"  "c:\users\reneh\appdata\roaming\python\python310\scripts\pipx.exe" install "mpf[cli]" --pip-args="--pre" --verbose --include-deps': Het systeem kan het opgegeven bestand niet vinden.

Last part means ''system cant find file'' This makes sense since I deleted version 310. When I go to the programs/python folder only the Python 390 folder is there.
I dont understand why it is still ''looking'' for 310?

I also started over again and got:

C:\Users\reneh>pip install --user pipx
Requirement already satisfied: pipx in c:\users\reneh\appdata\roaming\python\python39\site-packages (1.1.0)
Requirement already satisfied: packaging>=20.0 in c:\users\reneh\appdata\roaming\python\python39\site-packages (from pipx) (21.3)
Requirement already satisfied: colorama>=0.4.4 in c:\users\reneh\appdata\roaming\python\python39\site-packages (from pipx) (0.4.5)
Requirement already satisfied: userpath>=1.6.0 in c:\users\reneh\appdata\roaming\python\python39\site-packages (from pipx) (1.8.0)
Requirement already satisfied: argcomplete>=1.9.4 in c:\users\reneh\appdata\roaming\python\python39\site-packages (from pipx) (2.0.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\reneh\appdata\roaming\python\python39\site-packages (from packaging>=20.0->pipx) (3.0.9)
Requirement already satisfied: click in c:\users\reneh\appdata\roaming\python\python39\site-packages (from userpath>=1.6.0->pipx) (8.1.3)
WARNING: You are using pip version 22.0.4; however, version 22.3 is available.
You should consider upgrading via the 'C:\Users\reneh\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.


C:\Users\reneh>python -m pipx ensurepath
C:\Users\reneh\.local\bin is already in PATH.
C:\Users\reneh\AppData\Roaming\Python\Python39\Scripts is already in PATH.


⚠️  All pipx binary directories have been added to PATH. If you are sure you want to proceed, try again with the
'--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨


Does this mean I have to re-install PIP somehow?
Op donderdag 20 oktober 2022 om 22:11:51 UTC+2 schreef jo...@gill.nu:

Johan Gill

unread,
Oct 20, 2022, 4:35:14 PM10/20/22
to mpf-...@googlegroups.com
Check your environmental paths in Windows, https://www.computerhope.com/issues/ch000549.htm

Delete everything with python3.10. restart computer and try again.

/Gill

Flying (Dutchman)

unread,
Oct 20, 2022, 5:10:11 PM10/20/22
to MPF Users
Did just that; I deleted the 3.10 line and restarted. Error message on not being able to find the file is gone now but:

C:\windows\system32>pipx install "mpf[cli]" --pip-args="--pre" --verbose --include-deps

pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is 'C:\\Users\\reneh\\AppData\\Local\\Programs\\Python\\Python39\\python.exe'

pipx >(package_name_from_spec:323): Determined package name: mpf
pipx >(package_name_from_spec:324): Package name determined in 0.0s
'mpf' already seems to be installed. Not modifying existing installation in
'C:\\Users\\reneh\\.local\\pipx\\venvs\\mpf'. Pass '--force' to force installation.

C:\windows\system32>pipx inject mpf mpf-mc --pip-args="--pre" --verbose --include-deps --include-apps

pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is 'C:\\Users\\reneh\\AppData\\Local\\Programs\\Python\\Python39\\python.exe'

pipx >(run_pipx_command:169): Virtual Environment location is C:\Users\reneh\.local\pipx\venvs\mpf
Can't inject 'mpf-mc' into Virtual Environment 'mpf'. 'mpf' has missing internal pipx metadata. It was likely
installed using a pipx version before 0.15.0.0. Please uninstall and install 'mpf', or reinstall-all to fix.

So I try to uninstall mpf but:

C:\windows\system32>pip uninstall mpf
WARNING: Skipping mpf as it is not installed.

Thnx for all the help so far, much appriciated!

Op donderdag 20 oktober 2022 om 22:35:14 UTC+2 schreef jo...@gill.nu:

Flying (Dutchman)

unread,
Oct 20, 2022, 5:25:44 PM10/20/22
to MPF Users
Using Google also tried:

C:\Users\reneh>pipx uninstall mpf
No Python at 'c:\program files\python37\python.exe'
Traceback (most recent call last):
  File "C:\Users\reneh\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\reneh\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "c:\users\reneh\appdata\roaming\python\python39\scripts\pipx.exe\__main__.py", line 7, in <module>
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\main.py", line 819, in cli
    return run_pipx_command(parsed_pipx_args)
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\main.py", line 247, in run_pipx_command
    return commands.uninstall(venv_dir, constants.LOCAL_BIN_DIR, verbose)
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\commands\uninstall.py", line 124, in uninstall
    bin_dir_app_paths = _get_venv_bin_dir_app_paths(venv, local_bin_dir)
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\commands\uninstall.py", line 82, in _get_venv_bin_dir_app_paths
    venv_metadata = venv.get_venv_metadata_for_package(venv.root.name, set())
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\venv.py", line 300, in get_venv_metadata_for_package
    venv_metadata = inspect_venv(
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\venv_inspect.py", line 236, in inspect_venv
    (venv_sys_path, venv_env, venv_python_version) = fetch_info_in_venv(
  File "C:\Users\reneh\AppData\Roaming\Python\Python39\site-packages\pipx\venv_inspect.py", line 210, in fetch_info_in_venv
    venv_info = json.loads(
  File "C:\Users\reneh\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\reneh\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\reneh\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Op donderdag 20 oktober 2022 om 23:10:11 UTC+2 schreef Flying:

Johan Gill

unread,
Oct 21, 2022, 4:20:49 AM10/21/22
to MPF Users
I'm sorry but my knowledge of Python is lacking to help anymore.
I do see that you have " No Python at 'c:\program files\python37\python.exe'" in your log, do you have an old Python 3.7 installation? More Path's to remove in the enviromental variables perhaps?

One way around all this would be to create a new user on your computer and just start from scratch. Make sure you use Python 3.9 and follow the guide on missionpinball.org. Just check that the variables for Python is user variables and not system variables (I believe they all are user variables, but you can check in your Windows enviromental variables). 

Good luck.

/Gill

Flying (Dutchman)

unread,
Oct 22, 2022, 3:55:13 AM10/22/22
to MPF Users
Thanks a lot for the help Gill!

I actually really like the idea of having the MFP installation under a different user so I can keep the other work on my  computer sepperated.

I downloaded Python 3.9.11-amd64 and installed it whitout any problems. Now I can finally start building.

Thnx again.

Greetings from the Netherlands.



Op vrijdag 21 oktober 2022 om 10:20:49 UTC+2 schreef jo...@gill.nu:

Johan Gill

unread,
Oct 22, 2022, 7:05:08 AM10/22/22
to mpf-...@googlegroups.com
Great to hear you are up and running. Do you share your project anywhere?

/Gill

Flying (Dutchman)

unread,
Oct 23, 2022, 3:14:29 PM10/23/22
to MPF Users
Not yet, I would like to have working physical flipper before introducing my project. If I''m ready what would be the best place to do so?

Unfortunatly portune is not at my side yet. After succesfully running MPF and following the tutorial I ran into a problem trying to start MPF MC:

C:\Users\MPF\Pinball\Testmachine>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: VideoGstplayer: Using Gstreamer 1.18.5.0
kivy: Video: Provider: gstplayer
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:\Users\MPF\Pinball\Testmachine\config\config
ConfigProcessor: Loading config from file C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\mcconfig.yaml.
ConfigProcessor: Loading config: C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\mcconfig.yaml
ConfigProcessor: Loading config from file C:\Users\MPF\Pinball\Testmachine\config\config.
ConfigProcessor: Loading config: C:\Users\MPF\Pinball\Testmachine\config\config
ConfigProcessor: Config file cache created: C:\Users\MPF\AppData\Local\Temp\ae48c66735c52eb0a77313c8ee2da483.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\MPF\AppData\Local\Temp\7e755d9a57cde3b0b8fa587aea79a01d.mpf_cache
ConfigProcessor: Loading config from cache: C:\Users\MPF\AppData\Local\Temp\0b5bca7b8ff874f6c1043771bed9c324.mpf_cache
mpfmc: Mission Pinball Framework Media Controller v0.56.0-dev34
mpfmc: Mission Pinball Framework Game Engine v0.56.0-dev33
mpfmc: Machine path: C:\Users\MPF\Pinball\Testmachine
mpfmc: Starting clock at 60.0Hz
kivy: Text: Provider: sdl2
kivy: DLL load failed while importing sound_file: Kan opgegeven procedure niet vinden.

Traceback (most recent call last):
  File "C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\commands\mc.py", line 225, in __init__
    MpfMc(options=vars(args),
  File "C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\core\mc.py", line 151, in __init__
    create_config_collections(self, self.machine_config['mpf-mc']['config_collections'])
  File "C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\core\config_collection.py", line 82, in create_config_collections
    imported_module = import_module(module)
  File "C:\Users\MPF\AppData\Local\Programs\Python\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\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\config_collections\sound_loop_set.py", line 1, in <module>
    from mpfmc.core.audio.audio_exception import AudioException
  File "C:\Users\MPF\.local\pipx\venvs\mpf\lib\site-packages\mpfmc\core\audio\__init__.py", line 7, in <module>
    from mpfmc.core.audio.audio_interface import AudioInterface
  File "mpfmc/core/audio/audio_interface.pyx", line 1, in init mpfmc.core.audio.audio_interface
ImportError: DLL load failed while importing sound_file: Kan opgegeven procedure niet vinden.
kivy: Stopping child threads... (0 remaining)
kivy: All child threads stopped.

I'm confused since the code seems to be looking for all types of lines I dont even have....

Op zaterdag 22 oktober 2022 om 13:05:08 UTC+2 schreef jo...@gill.nu:

Johan Gill

unread,
Oct 23, 2022, 3:18:19 PM10/23/22
to mpf-...@googlegroups.com

Flying (Dutchman)

unread,
Oct 24, 2022, 2:12:29 PM10/24/22
to MPF Users
Thnx so much again Gill. This worked! Finally I have both MPF and MPF MC running thanks to your help!

Op zondag 23 oktober 2022 om 21:18:19 UTC+2 schreef jo...@gill.nu:
Reply all
Reply to author
Forward
0 new messages