CoSpar requires Python 3.8 or later. We recommend using Miniconda for package management. For a computer that does not have a package management tool yet, please install Miniconda first, and activate it by running the following command in the terminal:

source ~/.bash_profile


Install CoSpar to the activated Conda environment using:

conda install -c bioconda cospar


Install CoSpar from PyPI using:

pip install --upgrade cospar

If you get a Permission denied error, use pip install --upgrade cospar --user instead.

If you get errors related to ‘gcc’, try to specify the following gcc path for installation:

env CXX=/usr/local/Cellar/gcc/8.2.0/bin/g++-8 CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8 pip install  cospar

If you get errors for version conflicts with existing packages, try:

pip install --ignore-installed --upgrade cospar

Development Version

To work with the latest development version, install from GitHub using:

pip install git+


git clone
pip install -e cospar

-e is short for --editable and links the package to the original cloned location such that pulled changes are also reflected in the environment.


Jupyter Notebook

To run the tutorials in a notebook locally, please install:

conda install notebook

and run jupyter notebook in the terminal. If you get the error Not a directory: 'xdg-settings', use jupyter notebook --no-browser instead and open the url manually (or use this bugfix).

If you run into issues, do not hesitate to approach us or raise a GitHub issue.

Testing CoSpar in a new environment

In case you want to test cospar without affecting existing python packages, you can create a new conda environment and install CoSpar there:

conda create -n test_cospar python=3.8
conda activate test_cospar
pip install cospar

Now, install jupyter notebook in this environment:

pip install --user ipykernel

If you encounter an error related to nbconvert, run (this is optional):

pip3 install --upgrade --user nbconvert

Finally, install the jupyter notebook kernel related to this environment:

python -m ipykernel install --user --name=test_cospar

Now, you can open jupyter notebook by running jupyter notebook in the terminal, and select the kernel test_cospar to run CoSpar.