Skip to content

Use a Python environment

Molt runs the bundled kernel server with one configured Python executable. It does not install packages, create environments, or switch interpreters per tab. Any package importable by that executable is available to all four kernels.

Molt’s default interpreter setting is:

python3

Resolve that command in Terminal:

Terminal window
command -v python3
python3 --version

Choose a durable location outside the Molt application bundle. For example:

Terminal window
mkdir -p "$HOME/.virtualenvs"
python3 -m venv "$HOME/.virtualenvs/molt"
"$HOME/.virtualenvs/molt/bin/python" -m pip install --upgrade pip

Install the packages you need through that interpreter:

Terminal window
"$HOME/.virtualenvs/molt/bin/python" -m pip install numpy pandas

Confirm the environment before assigning it to Molt:

Terminal window
"$HOME/.virtualenvs/molt/bin/python" -c "import numpy, pandas; print(numpy.__version__, pandas.__version__)"
  1. Open File → Settings….

  2. In Python → Interpreter, enter the absolute executable path, such as:

    /Users/your-name/.virtualenvs/molt/bin/python
  3. Select Save.

  4. Quit Molt completely.

  5. Relaunch Molt.

  6. Run an import in a cell:

    import numpy as np
    np.arange(5)

Expected output resembles:

array([0, 1, 2, 3, 4])

You can point Molt at a project’s virtual environment:

/Users/your-name/projects/example/.venv/bin/python

This is useful for quick checks against the same dependencies as that project. Remember that all four tabs use the same interpreter path. Changing or deleting the environment while Molt is running can cause future kernel starts to fail.

The runtime configuration file is:

~/Library/Application Support/molt/config.toml

A minimal valid configuration is:

config.toml
[python]
interpreter = "/Users/your-name/.virtualenvs/molt/bin/python"
[app]
auto_launch = false
tab_count = 4
native_effects = true

Quit Molt before editing the file, then relaunch.

Molt reports that the interpreter is not found

Section titled “Molt reports that the interpreter is not found”

Run the exact configured path with --version:

Terminal window
"/absolute/path/to/python" --version

Correct permissions or the path, save it, and relaunch Molt.

A package imports in Terminal but not Molt

Section titled “A package imports in Terminal but not Molt”

Confirm that Terminal and Molt use the same executable:

Terminal window
"/absolute/path/to/python" -c "import sys; print(sys.executable)"

Then relaunch Molt. Restarting only the tab is not sufficient after a configuration change.

Molt has no package-management UI. Running pip as Python code is not a supported workflow. Install through Terminal with the selected interpreter’s -m pip form, then restart the relevant kernel or relaunch Molt as needed.