Installation
Prev: Part 1: Introduction
PyMFCAD is available on PyPI. The recommended installation method uses uv, with legacy venv/pip instructions provided for compatibility.
Choose one path below. If you already have an active environment, skip directly to the install step.
Why use uv?
uv is a fast, modern Python package manager that simplifies virtual environments and dependency management:
- Installs packages significantly faster than pip
- Automatically manages virtual environments
- Provides a simpler, more reliable workflow for modern Python projects
- Works as a drop-in replacement for pip in most cases
Python versions
PyMFCAD supports Python 3.10–3.14.
Option A — Install with uv (recommended)
- (Optional) Create a new project directory:
mkdir my-mf-project && cd my-mf-project - Install uv if you don't have it. Installation instructions can be found here.
- Create a virtual environment and install PyMFCAD:
uv venv uv pip install pymfcad - Quick verification (runs a built‑in demo):
uv run python -m examples.full_test
Option B — Install with venv and pip
- Create and activate a virtual environment:
- macOS/Linux:
python3 -m venv env source env/bin/activate - Windows:
- Command Prompt:
python -m venv env CALL env\Scripts\activate - Windows PowerShell:
python -m venv env .\env\Scripts\Activate.ps1
- Command Prompt:
- macOS/Linux:
- Install PyMFCAD from PyPI:
pip install pymfcad - Quick verification (runs a built‑in demo):
python -m examples.full_test
Quick check
You should be able to run a demo without errors and see the visualizer open.
Developing from source
If you are working from the repository, use the Makefile targets below (requires uv).
- Clone or download the repository.
- In a terminal, change into the repository root.
- Use the targets below to install and run the project.
Makefile targets
make init— creates the virtual environment, installs Python packages, and installs JS dependenciesmake build— builds the docs, Vite site, and packages with uvmake serve— updates docs, builds the Vite site, and serves the PyMFCAD webpagemake test— runs all PyTest test casesmake test-coverage— runs all PyTest test cases and outputs code coverage in htmlcovmake run <python file>— runs a Python filemake mem-profile <python file>— runs a Python file with heaptrackmake py-profile <python file>— runs a Python file with cProfilemake web-install— installs JS dependenciesmake web-build— builds the Vite sitemake clean— removes all build products
Release targets
For creating releases, the following targets are available (requires gh CLI):
make release-major— bumps major version, creates git commit, builds, and publishes GitHub releasemake release-minor— bumps minor version, creates git commit, builds, and publishes GitHub releasemake release-patch— bumps patch version, creates git commit, builds, and publishes GitHub release
Each release target will:
- Prompt whether this is a pre-release
- Open your default editor to collect release notes
- Bump the version in
pyproject.tomlanduv.lock - Create a git commit with the version bump
- Run
make cleanandmake build - Create and publish a GitHub release with binaries
Testing releases:
To test the release process without committing/updating version or publishing, use:
DRY_RUN=true make release-major
DRY_RUN=true make release-minor
DRY_RUN=true make release-patch
This runs through the entire workflow but creates a draft release on GitHub (not published).
GitHub CLI installation
The release targets require the gh CLI tool. Install it using your package manager:
macOS:
brew install gh
Linux (Ubuntu/Debian):
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
Fedora/RHEL:
sudo dnf install gh
Other systems:
See the official gh installation guide.
After installing, authenticate with your GitHub account:
gh auth login
Troubleshooting
Issue: pip install uv succeeds, but the uv command is not found.
Fix: Run pip show uv and add the reported install location to your PATH.
Issue: pip install pymfcad fails while building the manifold3d wheel.
Fix: Verify your Python version is supported (Python 3.10–3.14).