Installation for users¶
Capytaine is available on Windows, MacOS [1] and Linux.
Capytaine requires Python 3.6 or higher. Thus it is compatible with all currently supported version of Python.
With Conda¶
The easiest way to install Capytaine is the precompiled package available on Conda. Download and install the Anaconda distribution or its lightweight counterparts Miniconda and Miniforge.
Once Conda has been installed, you might want to create a dedicated environment. Capytaine’s package is available in the conda-forge channel and can be installed with the following command:
conda install -c conda-forge capytaine
The required dependencies should be installed automatically.
You can check which version of Capytaine has been installed by opening a Python shell and running:
import capytaine; print(capytaine.__version__)
Optional dependencies¶
Optional dependencies can be manually installed. They are nice to have but not necessary for Capytaine’s main features.
Name |
Example installation command |
Usage |
---|---|---|
matplotlib |
|
Used in several examples in the documentation and the cookbook |
vtk |
|
For 3D visualization |
joblib |
|
For parallel resolution |
meshio |
|
To load more mesh formats |
quadpy |
|
For higher order quadratures (experimental) |
With Pip¶
The package is available on PyPI, although only as a source distribution. That means that you’ll need a Fortran compiler [2] in order to install the package. If you do, you can install Capytaine as:
pip install capytaine
If you can’t install a compiler, it is recommended to use Conda instead.
For example, on Ubuntu or Debian: sudo apt install gfortran
.
On macOS, see for instance these instructions.
With Docker¶
The following command will create a Docker image based on Ubuntu 22.04 with the version v1.5 of Capytaine:
docker build -t capytaine:v1.5 https://github.com/capytaine/capytaine.git#v1.5
Replace v1.5
by master
to download instead the latest development version.
Use the following command to open an IPython shell in which Capytaine can be imported:
docker run -it capytaine:v1.5 ipython3
Or the following command to make the current directory accessible from the Docker image and run the file my_script.py
from the current directory:
docker run -it -v $(pwd):/home/user capytaine:v1.5 python3 my_scipt.py
Note that graphical displays (matplotlib, vtk, …) might require a complex setup to work from the Docker image.