Installation#
To install fairchem-core
you will need to setup the fairchem-core
environment (using conda or pip)
and then either install fairchem-core
package directly or install a development version from our git repository.
Environment#
You can install the environment using either conda or pip
Conda#
We do not have official conda recipes (yet!); in the meantime you can use the following environment yaml files to setup on CPU or GPU. If conda is too slow for you, please consider using mamba
Create an environment to install fairchem
a. GPU
The default environment uses cuda 11.8, if you need a different version you will have to edit pytorch-cuda version accordingly.
wget https://raw.githubusercontent.com/FAIR-Chem/fairchem/main/packages/env.gpu.yml conda env create -f env.gpu.yml
b. CPU
wget https://raw.githubusercontent.com/FAIR-Chem/fairchem/main/packages/env.cpu.yml conda env create -f env.cpu.yml
Activate the environment
conda activate fair-chem
PyPi#
You can also install pytorch
and torch_geometric
dependencies from PyPI to select specific CPU or CUDA versions.
Install
pytorch
by selecting your installer, OS and CPU or CUDA version following the official Pytorch docsInstall
torch_geometric
and thetorch_scatter
,torch_sparse
, andtorch_cluster
optional dependencies similarly by selecting the appropriate versions in the official PyG docs
Standard installation of fairchem-core#
Install fairchem-core
from PyPi
pip install fairchem-core
Additional packages#
fairchem
is a namespace package, meaning all packages are installed seperately. If you need
to install other packages you can do so by:
pip install fairchem-{package-to-install}
Available fairchem
packages are fairchem-core
,fairchem-data-oc
,fairchem-demo-ocpapi
,fairchem-applications-cattsunami
Development installation#
If you plan to make contributions you will need to fork and clone (for windows user please see next section) the repo, set up the environment, and install fairchem-core from source in editable mode with dev dependencies,
git clone https://github.com/FAIR-Chem/fairchem.git
cd fairchem
pip install -e packages/fairchem-core[dev]
pytest tests/core
And similarly for any other namespace package:
pip install -e packages/fairchem-{package-to-install}
Cloning and installing the git repository on windows#
Our build system requires the use of symlinks which are not available by default on windows. To properly build fairchem packages you must enable symlinks and clone the repository with them enabled.
When installing git on your machine make sure “enable symbolic links” is checked (download git installer) (see here for detailed instructions )
Enable developer mode (instructions) or run the following commands as administrator
Run the git clone command with symlinks enabled
git clone -c core.symlinks=true https://github.com/FAIR-Chem/fairchem.git