Installation#
ZOSPy is available through PyPI and conda-forge.
To install ZOSPy via pip, run the following command in your terminal:
pip install zospy
To install ZOSPy via conda, run the following command in your terminal:
conda install conda-forge::zospy
Using ZOSPy in a separate environment#
We recommend to use ZOSPy in a separate (virtual) environment to prevent conflicts with other packages or older ZOS-API projects.
To create a new conda environment named ‘optics’, with Python 3.12 and ZOSPy installed, run the following commands:
conda create -n optics -c conda-forge python=3.12 zospy
To create a new virtual environment named ‘zospy_venv’, with ZOSPy installed, run the following commands:
# Create a new virtual environment
python -m venv zospy_venv
# Activate the virtual environment
.\zospy_venv\Scripts\activate
# Install ZOSPy in the virtual environment
pip install zospy
Note
Although the venv module is included in the Python standard library, there are many environment management tools available
that are easier to use, such as virtualenv, uv,
pipenv, and poetry.
We recommend using one of these tools for managing your virtual environments.