Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 3.42 KB

INSTALLING.rst

File metadata and controls

96 lines (63 loc) · 3.42 KB

pip (recommended)

To install pycalphad from PyPI using pip:

pip install -U pip setuptools
pip install -U pycalphad

A recommended best practice is to install pycalphad into a virtual environment. To create an environment called pycalphad-env on Linux and macOS/OSX:

python -m venv pycalphad-env
source pycalphad-env/bin/activate
pip install -U pip setuptools
pip install -U pycalphad

This environment must be activated every time you use pycalphad.

conda

Anaconda is a distribution platform for scientific Python packages created by Anaconda, Inc. It comes bundled with the conda package manager to install Python and non-Python packages. If you don't have Anaconda already, you can download the Miniconda distribution.

To install pycalphad from conda-forge using conda:

conda install -c conda-forge pycalphad

Development version

Installing

The source code for the latest development version of pycalphad is available on GitHub. You will need a working version of git to download the source code. Installing development versions of pycalphad also requires a working C++ compiler.

To install an editable version the latest development branch of pycalphad, run:

git clone https://github.com/pycalphad/pycalphad.git
cd pycalphad
pip install -U pip setuptools
pip install -U -r requirements-dev.txt
pip install -U --no-build-isolation --editable .

Then run the automated tests to ensure everything installed correctly:

pytest pycalphad

Upgrading

Changes to Python files (.py extension) in an editable install will be reflected as soon a file is saved. Changes to Cython files (.pyx and .pxd extensions) must be recompiled before they take effect. The Cython files can be recompiled by running (from the root directory [1] of the project):

python setup.py build_ext --inplace

By default, the development version installed will track the latest changes in the develop branch of pycalphad on GitHub.

To update the code in the current branch to the latest changes on GitHub, the changes are pulled from GitHub by running git pull.

To switch to a different branch, e.g. master (which tracks the latest released version) or another feature branch, run git checkout <branch>, where <branch> is the name of the branch to checkout, such as master (without the brackets < and >).

[1]The "root directory" is the the top level project directory containing the pyproject.toml file, the pycalphad/ package directory, etc.