Installation¶
To install Saber, you will need python3.6
. If not already installed, python3
can be installed via
- The official installer
- Homebrew, on MacOS (
brew install python3
) - Miniconda3 / Anaconda3
Note
Run python --version
at the command line to make sure installation was successful. You may need to type python3
(not just python
) depending on your install method.
(OPTIONAL) Activate your virtual environment (see below for help)
$ conda activate saber # Notice your command prompt has changed to indicate that the environment is active (saber) $
Latest PyPI stable release¶
(saber) $ pip install saber
Error
The install from PyPI is currently broken, please install using the instructions below.
Latest development release on GitHub¶
Pull and install straight from GitHub
(saber) $ pip install git+https://github.com/BaderLab/saber.git
or install by cloning the repository
(saber) $ git clone https://github.com/BaderLab/saber.git (saber) $ cd saber
and then using either pip
(saber) $ pip install -e .
setuptools
(saber) $ python setup.py install
Note
See Running tests for a way to verify your installation.
(OPTIONAL) Creating and activating virtual environments¶
When using pip
it is generally recommended to install packages in a virtual environment to avoid modifying system state. To create a virtual environment named saber
Using virtualenv or venv¶
Using virtualenv
$ virtualenv --python=python3 /path/to/new/venv/saber
Using venv
$ python3 -m venv /path/to/new/venv/saber
Next, you need to activate the environment.
$ source /path/to/new/venv/saber/bin/activate # Notice your command prompt has changed to indicate that the environment is active (saber) $
Using Conda¶
If you use Conda / Miniconda, you can create an environment named saber
by running
$ conda create -n saber python=3.6
To activate the environment
$ conda activate saber # Notice your command prompt has changed to indicate that the environment is active (saber) $
Note
You do not need to name the environment saber
.
Running tests¶
Sabers test suite can be found in saber/tests
. If Saber is already installed, you can run pytest
on the installation directory
# Install pytest (saber) $ pip install pytest # Find out where Saber is installed (saber) $ INSTALL_DIR=$(python -c "import os; import saber; print(os.path.dirname(saber.__file__))") # Run tests on that installation directory (saber) $ python -m pytest $INSTALL_DIR
Alternatively, to clone Saber, install it, and run the test suite all in one go
(saber) $ git clone https://github.com/BaderLab/saber.git (saber) $ cd saber (saber) $ python setup.py test