Skip to content

Commit

Permalink
Installation Apple Silicon (#393)
Browse files Browse the repository at this point in the history
* Added installation and contributing instructions for Apple Silicon users.

* Fixed macOS spelling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Note formatting adjusted

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Lilly-May and pre-commit-ci[bot] authored Oct 5, 2023
1 parent 3a8e597 commit b58f7fc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit b58f7fc

Please sign in to comment.