Installation

Inside a virtualenv

Often users or systems administrators need to install multiple versions of the same package for different scientific purposes. To do so they use sandboxes that insulate packages from each other.

The easiest way to install Plastid inside a sandbox is to use virtualenv:

# install virtualenv if you don't have it.
# use either "sudo" or "--user", not both.

# Use this line for a system-wide install
$ sudo pip install virtualenv

# or, use this line for single user install
$ pip install --user virtualenv

# With virtualenv installed, create & activate vanilla environment
# when prompted, do NOT give the virtualenv access to system packages

# create
$ virtualenv ~/some/path/to/venv

# activate
$ source ~/some/path/to/venv/bin/activate

# Fresh install of plastid.
# Note- no use of `sudo` here. It confuses the virtualenv
(venv) $ pip install numpy pysam cython
(venv) $ pip install --no-cache-dir plastid

# test
(venv) $ python -c "from plastid import *"

Development versions

To fetch the latest development versions, clone it from our github repository. From the terminal:

# get the source
$ git clone git://github.com/joshuagryphon/plastid.git

# Do to a quirk in Python setup scripts (fixed in new versions of pip),
# numpy, cython, and pysam must must be installed first:
$ pip install --user --upgrade numpy pysam

# Install in develop mode. Use `--recythonize` flag to regenerate
# C files if necessary (e.g. after upgrading pysam)
$ cd plastid
$ pip install --install-option='--recythonize' --user -e .

Non-Python Dependencies

Plastid has a number of non-Python dependencies:

  • A full build system for C compiling (e.g. GCC or clang)
  • zlib, including its headers

The following are not required for full functionality, but are required for specific functions or just plain useful:

Troubleshooting

plastid installs fairly easily in most Linux and Macintosh setups. If you run into issues running or installing, please see our FAQ section on installation and then our issue tracker to see if anybody else has encountered your issue, and if instructions already exist.

Frequently, problems can be solved by installing plastid in a clean environment. For instructions, see Inside a virtualenv, above.

Notes on conda

Numerous users have reported unexpected behaviors when installing plastid in conda/Anaconda environments. These can appear at runtime, or after installation. Notably, plastid is not the only package to experience this incompatibility.

These issues can take a long time to resolve and frequently the solution is installation inside a clean environment that does not use conda. We’re looking into this issue to improve our compatibility, but at present, conda is not supported. If you need to run plastid inside a sandbox, we strongly recommend using virtualenv. To do so, see Inside a virtualenv, above.

For other troubleshooting, please see our FAQ section on installation.