Skip to content

Setup development environment with conda

Rory Yorke edited this page Jan 19, 2025 · 6 revisions

This creates an environment with Numpy, Scipy, Matplotlib, and Slycot, and in which changes you make to python-control are immediately available. "Immediately" is not quite true: in a continuously running Python environment, you will have to reload python-control to make any changes have an effect; you could use the IPython autoreload extension for that, or just quit and restart Python (IPython, Jupyter Python kernel, etc.).

This method uses mamba to get the latest releases of Numpy, Slycot, etc., in an isolated environment. You can create as many environments as you need, e.g., one for each different version of Python.

Install mamba from https://github.com/conda-forge/miniforge ; see that link for how to install, setup, and use mamba.

In your base environment, install conda-build:

mamba install conda-build

Next, create the environment. control-dev is the environment name, which you can change.

mamba create -n control-dev slycot scipy matplotlib pytest-timeout
mamba activate control-dev

Depending on what you're doing and how you go about developing and testing, you could add other packages, e.g., IPython:

mamba install ipython

Finally, add your python-control source to the control-dev environment. This command must be run inside your python-control working tree:

conda develop .

You can check that everything is OK by running pytest in the root of the python-control working tree.