Skip to content

Commit

Permalink
Added installation and contributing instructions for Apple Silicon us…
Browse files Browse the repository at this point in the history
…ers.
  • Loading branch information
Lilly-May committed Oct 4, 2023
1 parent 707a0d5 commit c55102b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ 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 Installation guide](installation.md#apple-silicon) and replace the last two steps described there with the code above.

## Code-style

Expand Down
35 changes: 35 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,43 @@ 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 (``ìmport 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/

0 comments on commit c55102b

Please sign in to comment.