Skip to content

Getting Started

VLab4Mic is compatible with Python 3.10, 3.11, 3.12, and 3.13 on macOS, Windows, and Linux.


Step 1 — Create and Activate a Virtual Environment

Tip

We recommend installing VLab4Mic in a dedicated virtual environment to avoid dependency conflicts. The examples below use Python's built-in venv; pyenv or Conda can also be used as alternatives.

python3 -m venv .venv
source .venv/bin/activate

Step 2 — Install VLab4Mic

For Python scripts only:

pip install vlab4mic

Including Jupyter notebook support:

pip install vlab4mic "vlab4micjupyter[local]"

On first use, VLab4Mic may download required PDB/CIF structure files. These runtime files are stored in your user folder at ~/.vlab4mic/structures, not in the installed Python package directory. Set VLAB4MIC_STRUCTURE_DIR to use a different cache location.


Verify Installation

Check that VLab4Mic is installed correctly:

import vlab4mic
from importlib.metadata import version

print("VLab4Mic", version("vlab4mic"))

Or run a minimal simulation:

from vlab4mic.experiments import image_vsample

images, noiseless, experiment = image_vsample(run_simulation=True)
print("Installation successful!")

Next Steps

  • Use Jupyter Notebooks


    Run VLab4Mic without writing code in Google Colab or a local Jupyter Lab.

    Notebooks guide →

  • Use Python Scripts


    Run VLab4Mic from the command line or a Python interpreter.

    Python usage guide →