conda install seaborn scikit-learn statsmodels numba pytables conda install -c conda-forge python-igraph leidenalg
Pull Scanpy from PyPI (consider using
pip3 to access Python 3):
pip install scanpy
If you prefer to exclusively use PyPI run:
pip install 'scanpy[leiden]'
To work with the latest version on GitHub: clone the repository and
its root directory. To install using symbolic links (stay up to date with your
cloned version after you update with
git pull) call:
pip install -e .
If you get a
Permission denied error, never use
sudo pip. Instead, use virtual environments or:
pip install --user scanpy
On MacOS, if not using
conda, you might need to install the C core of igraph via homebrew first
brew install igraph
If python-igraph still fails to install, see the question on compiling igraph. Alternatively consider installing gcc via
brew install gcc --without-multiliband exporting the required variables:
export CC="/usr/local/Cellar/gcc/X.x.x/bin/gcc-X" export CXX="/usr/local/Cellar/gcc/X.x.x/bin/gcc-X"
xrefers to the version of
gcc; in my case, the path reads
On Windows, there also often problems installing compiled packages such as
but you can find precompiled packages on Christoph Gohlke’s unofficial binaries.
Download those and install them using
pip install ./path/to/file.whl
After downloading Miniconda, in a unix shell (Linux, Mac), run
cd DOWNLOAD_DIR chmod +x Miniconda3-latest-VERSION.sh ./Miniconda3-latest-VERSION.sh
and accept all suggestions.
Either reopen a new terminal or
source ~/.bashrc on Linux/
source ~/.bash_profile on Mac.
The whole process takes just a couple of minutes.