If you’re just planning to use the code, you’ll want to perform a basic installation. If you’re planning to develop for the code, or if you want to stay on the bleeding edge, then you should perform a developer installation.
There are two recommended approaches for a basic installation:
conda is much easier, and will
continue to be easier for anything else you install. However, the
disadvantage is that you must put your entire Python environment under
conda. If you already have a highly customized Python environment, you
might prefer the
pip install. But otherwise, we highly recommend
conda, either using the full Ananconda distribution or the smaller-footprint miniconda. Once
conda is installed and in
your path, installation is as simple as:
conda install -c conda-forge contact_map
conda to get
contact_map from the conda-forge channel, which manages our
If you would prefer to use
pip, that takes a few extra steps, but will
work on any Python setup (
conda or not). Because of some weirdness in
pip handles packages (such as MDTraj) that have a particular types
of requirements from Numpy, you should install Cython
and Numpy separately, so the whole install is:
pip install cython pip install numpy pip install contact_map
If you already have Numpy installed, you may need to re-install it with
pip install -U --force-reinstall numpy. Note that some systems may
require you to preface
pip install commands with
sudo (depending on
where Python keeps its packages).
If you plan to work with the source, or if you want to stay on the bleeding edge, you can install a version so that your downloaded/cloned version of this git repository is the live code your Python interpreter sees. We call that a “developer installation.”
This is a three-step process:
Download or clone the repository. If you plan to contribute changes back to the repository, please fork it on GitHub and then clone your fork. Otherwise, you can download or clone the main repository. You can follow GitHub’s instructions on how to do this, and apply those steps to forking our repository at http://github.com/dwhswenson/contact_map.
Install the requirements. This can be done using either
conda. First, change into the directory for the repository. You should see
requirements.txt(among many other things) in that directory. Using conda:
conda install -y --file requirements.txt
pip install cython pip install numpy pip install -r requirements.txt
In some cases, you may need to add
-U --force-reinstallto the Numpy step.
Install the package. Whether you get the requirements with
conda, you can install the package (again, from the directory containing
pip install -e .
-emeans that the installation is “editable” (developer version; the stuff in this directory will be the live code your Python interpreted uses) and the
.tells it to find
setup.pyin the current directory.
Testing your installation¶
However you have installed it, you should test that your installation works. To do so, first check that the new package can be imported. This can be done with
python -c "import contact_map"
If your Python interpreter can find the newly-installed package, that should exit without complaint.
For a more thorough check that everything works, you should run our test
suite. This can be done by installing
pytest (using either
conda) and then running the command:
py.test --pyargs contact_map -v
This will run the tests on the installed version of
tests should either pass or skip.