Installation#

To use scanpy from another project, install it using your favourite environment manager:

Adding scanpy[leiden] to your dependencies is enough. See below for how to use Scanpy’s Development Version.

If you use Hatch or pip, the extra [leiden] installs two packages that are needed for popular parts of scanpy but aren’t requirements: igraph [Csárdi and Nepusz, 2006] and leiden [Traag et al., 2019]. If you use conda, you should to add these dependencies to your environment individually.

Development Version#

To work with the latest version on GitHub: clone the repository and cd into its root directory.

$ gh repo clone scverse/scanpy
$ cd scanpy

To use one of the predefined Hatch environments in hatch.toml, run either hatch test [args] or hatch run [env:]command [...args], e.g.:

$ hatch test -p               # run tests in parallel
$ hatch run docs:build        # build docs
$ hatch run towncrier:create  # create changelog entry

Docker#

If you’re using Docker, you can use e.g. the image gcfntnu/scanpy from Docker Hub.

Troubleshooting#

If you get a Permission denied error, never use sudo pip. Instead, use virtual environments or:

$ pip install --user scanpy