Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Apple Silicon #393

Merged
merged 5 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/