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

docs: update installation guide to use pixi package manager #120

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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
61 changes: 44 additions & 17 deletions docs/install_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,60 @@

### The easy way

The easiest way to install AnyPyTools on Windows (along with all dependencies) is through the Anaconda Python
Distribution and the conda package manager.
The esiest way to get started is using the pixi package manager. It will
automatically install python and all needed depencies for you.

Install AnyPyTools with the following command:

```bat
> conda config --add channels conda-forge
> conda install anypytools
Install the [pixi](https://pixi.sh/) package manager for Python.

```bash
powershell -ExecutionPolicy ByPass -c "irm -useb https://pixi.sh/install.ps1 | ie
```

This will install `anypytools` and all the recommended dependencies. Next, try to launch the
interactive AnyPyTools notebook tutorial :
After installation, open your working directory for you project in the terminal
and run the following command:

```bat
> AnyPyToolsTutorial.bat
```bash
pixi init
pixi add anypytools
pixi install
```

### Other installations options
This will create a virtual python environment in that folder and install the
AnyPyTools package. Likwise, you can add other depedencies to the virtual
environment (e.g. `pixi add jupyter pandas`). All dependencies are tracked in
the `pixi.yaml` file which can also be edited manually.

You can now activate the virtual environment with `pixi shell` and run your
scripts. Otherwise, you can prefix your commands with `pixi run` to run them in
the virtual environment, e.g. `pixi run python myscript.py`.


### Controling the version of AnyBody used by AnyPyTools

It is also possible to install directly from the python package index.
The clever part of using a package manger like pixi is that you can also control
which version of the AnyBody is used by AnyPyTools.

```bat
> pip install AnyPyTools
A light gui-less version of AnyBody exists as
[conda-packages](https://anaconda.org/anybody/anybodycon). Hence, we can install
a specific version of AnyBody into our virtual environment.

To do this we first need to add the `anybody` channel to our project.

```bash
pixi project channel add anybody`
```

or clone/download the source files from [GitHub](https://github.com/AnyBody-Research-Group/AnyPyTools), and then run the following command in the source folder to install:
Then we can install a specific version of AnyBody console application.

```bat
> pip install -e .
```bash
pixi add anybodycon=8.0.4
```

Now all simulations executed with AnyPyTools in this project will use the
specified version of AnyBody, regardsless of what is installed on the host
system.

:::{note}
You still need valid AnyBody license to run the simulations with the AnyBody Conda packages.
:::
Loading