diff --git a/docs/contributing.md b/docs/contributing.md index 6e397c16..6e7aabcd 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -13,10 +13,16 @@ In addition to the packages needed to _use_ this package, you need additional py the documentation_. It's easy to install them using `pip`: ```bash +git clone https://github.com/theislab/pertpy.git cd pertpy pip install -e ".[dev,test,doc]" ``` +```{note} +If you're working on an Apple Silicon machine, the installation is slightly more complex. In that case, follow +the steps described in the Apple Silicon section of the installation guide and replace the last two steps described there with the code above. +``` + ## Code-style This project uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either diff --git a/docs/installation.md b/docs/installation.md index caf923df..4d03720f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -40,8 +40,50 @@ Once you have a copy of the source, you can install it with: $ make install ``` +## Apple Silicon + +If you want to install and use pertpy on a machine with macOS and M-Chip, the installation is slightly more complex. +This is because pertpy depends on [scvi-tools], which can currently only run on Apple Silicon machines when installed +using a native python version (due to a dependency on jax, which cannot be run via Rosetta). + +Follow these steps to install pertpy on an Apple Silicon machine (tested on a MacBook Pro with M1 chip and macOS 14.0): + +1. Install [Homebrew] + +2. Install Apple Silicon version of Mambaforge (If you already have Anaconda/Miniconda installed, make sure + having both mamba and conda won't cause conflicts) + + ```console + $ brew install --cask mambaforge + ``` + +3. Create a new environment using mamba (here with python 3.10) and activate it + + ```console + $ mamba create -n pertpy-env python=3.10 + $ mamba activate pertpy-env + ``` + +4. Clone the GitHub Repository + + ```console + $ git clone https://github.com/theislab/pertpy.git + ``` + +5. Go inside the pertpy folder and install pertpy + ```console + $ cd pertpy + $ pip install . + ``` + Now you're ready to use pertpy as usual within the environment (`import pertpy`). + ``` + + ``` + [github repo]: https://github.com/theislab/pertpy [pip]: https://pip.pypa.io [poetry]: https://python-poetry.org/ [python installation guide]: http://docs.python-guide.org/en/latest/starting/installation/ [tarball]: https://github.com/theislab/pertpy/tarball/master +[scvi-tools]: https://docs.scvi-tools.org/en/latest/installation.html +[Homebrew]: https://brew.sh/