Python Setup
MLOps Desktop uses your system Python to run ML pipelines. This guide covers installation and configuration.
Check Your Python Installation
Section titled “Check Your Python Installation”Open Terminal and run:
python3 --versionYou should see Python 3.9 or later. If not installed, follow the installation steps below.
Installing Python
Section titled “Installing Python”Homebrew is the easiest way to manage Python on macOS:
# Install Homebrew if you don't have it/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Pythonbrew install python@3.11
# Verifypython3 --versionDownload from python.org:
- Download the latest Python 3.11+ installer
- Run the
.pkginstaller - Follow the installation prompts
- Open a new Terminal and verify:
python3 --version
For managing multiple Python versions:
# Install pyenvbrew install pyenv
# Add to shell config (~/.zshrc)echo 'eval "$(pyenv init -)"' >> ~/.zshrcsource ~/.zshrc
# Install Pythonpyenv install 3.11.0pyenv global 3.11.0
# Verifypython3 --versionRequired Packages
Section titled “Required Packages”MLOps Desktop requires these Python packages:
| Package | Purpose |
|---|---|
scikit-learn | ML algorithms (Random Forest, Gradient Boosting, etc.) |
pandas | Data loading and manipulation |
numpy | Numerical operations |
optuna | Hyperparameter tuning |
shap | Model explainability |
matplotlib | Visualization (for SHAP plots) |
Install All Packages
Section titled “Install All Packages”Run this command to install everything:
pip3 install scikit-learn pandas numpy optuna shap matplotlibVerify Installation
Section titled “Verify Installation”Test that packages are installed correctly:
python3 -c "import sklearn, pandas, numpy, optuna, shap; print('All packages installed!')"Configure Python in MLOps Desktop
Section titled “Configure Python in MLOps Desktop”-
Open MLOps Desktop
-
Check auto-detected path
The app shows the detected Python path in the toolbar. Click it to see the full path.
-
Change Python path (if needed)
If the wrong Python is detected:
- Click the Python path in the toolbar
- Enter the correct path (e.g.,
/opt/homebrew/bin/python3) - Press Enter to save
-
Verify packages
Run a simple pipeline to confirm packages are available.
Finding Your Python Path
Section titled “Finding Your Python Path”Not sure which Python to use? Run these commands:
# Show all Python installationswhich -a python3
# For Homebrew Python/opt/homebrew/bin/python3 --version
# For system Python (not recommended)/usr/bin/python3 --versionCommon paths:
| Installation | Path |
|---|---|
| Homebrew (Apple Silicon) | /opt/homebrew/bin/python3 |
| Homebrew (Intel) | /usr/local/bin/python3 |
| Official installer | /Library/Frameworks/Python.framework/Versions/3.X/bin/python3 |
| pyenv | ~/.pyenv/shims/python3 |
Virtual Environments
Section titled “Virtual Environments”Using venv
Section titled “Using venv”# Create a virtual environmentpython3 -m venv ~/.mlops-env
# Activate itsource ~/.mlops-env/bin/activate
# Install packagespip install scikit-learn pandas numpy optuna shap matplotlib
# Get the Python path for MLOps Desktopwhich python# → /Users/yourname/.mlops-env/bin/pythonUse this path in MLOps Desktop to ensure consistent package versions.
Using conda
Section titled “Using conda”# Create environmentconda create -n mlops python=3.11
# Activateconda activate mlops
# Install packagesconda install scikit-learn pandas numpy optuna shap matplotlib
# Get pathwhich python# → /opt/homebrew/anaconda3/envs/mlops/bin/pythonTroubleshooting
Section titled “Troubleshooting””No module named ‘sklearn’”
Section titled “”No module named ‘sklearn’””The package is named scikit-learn but imported as sklearn:
pip3 install scikit-learn“pip: command not found”
Section titled ““pip: command not found””Use pip3 instead of pip:
pip3 install package-namePackage installed but not found
Section titled “Package installed but not found”You may have multiple Python installations. Check which pip you’re using:
which pip3# Make sure it matches the Python path in MLOps DesktopSHAP installation fails
Section titled “SHAP installation fails”SHAP requires a C compiler. Install Xcode command line tools:
xcode-select --installThen retry: pip3 install shap
Permission errors
Section titled “Permission errors”On modern macOS, use --user or --break-system-packages:
pip3 install --user scikit-learn# ORpip3 install --break-system-packages scikit-learnNext: Quickstart — Build your first pipeline