Installation
The newest versions of the package are compatible with Python >= 3.8 (tested on 3.8, 3.9, 3.9, 3.10 and 3.11). DScribe versions <= 0.2.7 also support Python 2.7.
pip
The latest stable release is available through pip:
pip install dscribe
Since version 2.0.1, wheel distributions are available for several platforms using cibuildwheel. For more exotic platforms a source distribution is available, but this will require a compilation step during installation.
conda
We also provide a conda package through the conda-forge project. To install the package with conda, use the following command:
conda install -c conda-forge dscribe
From source
To install the latest development version from source, clone the source code from github and install with pip from local file:
git clone https://github.com/SINGROUP/dscribe.git
cd dscribe
git submodule update --init
pip install .
When installing from source, the contained C++ extensions are automatically compiled during install. On Linux-based systems the compilation tools are typically installed by default, on MacOS you may need to install additional command line tools if facing issues during setup (see common issues below).
Common issues
fatal error: pybind11/pybind11.h: No such file or directory: The package depends on pybind11 which is used for communication between python and the C++ extensions. Although pybind11 is specified as a requirement in setup.py, you may experience issues in pip correctly finding it. In this case you will need to install pybind11 before attempting to install dscribe by using the following command:
pip install pybind11fatal error: Python.h: No such file or directory: The package depends on C/C++ extensions that are compiled during the setup. For the compilation to work you will need to install the pythonX.X-dev-package, where X.X is the python version you use to run dscribe. E.g. for python 3.7 on Ubuntu this package could be installed with:
sudo apt install python3.7-devInstallation errors on MacOS: The package depends on C++ extensions that are compiled during the setup. If experiencing problems with setup on MacOS, you may need to install the Xcode Command Line tools package. This can be done with:
xcode-select --install
Missing headers when installing via pip on MacOS: When installing the package via
pip
, the package needs to compile some additional headers. Your MacOS might not have the necessary header files. One option is to useg++
installed via homebrewbrew install gcc
. Assuming your homebrew install folder is<homebrew>
(usually this is/opt/homebrew
). Check which compiler is used by your build system, this will usually be visible in the error log when installing dscribe via pip. Assuming the build system uses the c++ compiler and you installedc++13
with brew, alias the homebrew compileralias c++=<homebrew>/bin/c++-13
. Specify the necessary includes before invoking pip, as follows (the exact paths might be different on your system):CPPFLAGS="-I<hombrew>/include/c++/13/ -I<hombrew>/include/c++/13/aarch64-apple-darwin23/ -ftemplate-depth=1500" \ pip install dscribe