There are two options for installing PyChrono on your computer. The first one uses a prebuilt conda packages and is the recommended way. The second one is for users who need to build the full library from the C++ source.
A) Install precompiled Python modules
We provide precompiled PyChrono modules that can be installed in Python in a single step. PyChrono modules are available both for the latest released code, as well as for the latest version of the code in the git main branch. Conda packages are made available for Linux, Windows and MacOS, and for different versions of Python3.
To install a PyChrono conda module, do the following:
- Install the Anaconda Python distribution.
We strongly recommend to use a dedicated conda environment and install the desired Python distribution, necessary dependencies, and PyChrono package under that environment.
To create a
chronoenvironment with Python 3.12, use:
Then activate that environment:
so that all subsequent conda commands occur within that environment.
Decide which version of the Chrono code (latest release or latest code) you want and for which Python version. Consult the list of available modules on the PyChrono Anaconda Repository and download the appropriate archive (tar.bz2).
PyChrono packages built from a Chrono release version have label 'release'; PyChrono packages built from the latest Chrono development code have label 'main'.
- Install the PyChrono conda package. If you want to install the latest developmental branch, run
Otherwise, run with the specific version code you want to install, for example:
B) Build Python modules from the C++ API
Advanced users that use the entire Chrono C++ API can build PyChrono from scratch. This is the preferred way to have the most updated PyChrono, but it is more complicated. Do this:
- install the Chrono API with C++ source code and build it,
- install Python (only Python version 3.2 or greater is supported). Or, if you have hard disk space, better install a full stack like Anaconda
- build the PyChrono module, following these instructions