populse_mia.install.mia_install¶
Initialize the Populse Mia installation environment.
This module provides the first stage of the Mia installation process. It verifies that the Python packages required by the installer are available, installs any missing dependencies, and then launches the graphical installer.
In fact, this module exists for historical reasons. Originally, the installation of Mia was handled separately from populse_mia, so we needed to make sure that PyQt5 and other required dependencies were properly installed and available on the system. Today, this module is part of populse_mia, and since PyQt5 and the other required packages are dependencies of populse_mia, they should normally be installed automatically when populse_mia is installed via pip. We are keeping the module because it only adds a few additional checks, with little to no significant impact on execution time. It can also still be useful for detecting and fixing certain configuration or installation issues.
The module is intended to run only in user mode.
Functions
|
Ensure that a Python module is available. |
Launch the Populse Mia installation wizard. |
- populse_mia.install.mia_install.install_and_import(module_name)[source]¶
Ensure that a Python module is available.
The function first attempts to import the requested module. If it is not installed, it installs the corresponding package using
pipand retries the import.When executed inside a virtual environment, the package is installed into that environment. Otherwise, the installation is performed with the
--useroption.- Parameters:
module_name (str) – Name of the package to install.
- Raises:
subprocess.CalledProcessError – If the package installation fails.
ImportError – If the module cannot be imported after installation.
Note
Some package names differ from their import names. For example,
pyyamlis installed from PyPI but imported asyaml.
- populse_mia.install.mia_install.run_installer()[source]¶
Launch the Populse Mia installation wizard.
This function verifies that all Python packages required by the installer are available. Missing packages are installed automatically whenever possible. Once the installation environment has been validated, the graphical installation wizard is created and displayed.
If a required dependency cannot be imported after installation, the process terminates with an error message describing how to retry the installation.