Installation
Installing pre-built binaries with conda (Mac OSX, OSX-ARM64, and Linux)
By far the simplest and recommended way to install climlab
is using conda
(which is the wonderful package manager that comes with Anaconda Python).
You can install CLIMLAB and all its dependencies with:
conda install -c conda-forge climlab
Or (recommended) add conda-forge
to your conda channels with:
conda config --add channels conda-forge
and then simply do:
conda install climlab
Binaries are available for OSX and Linux. Some binaries for earlier versions are available for Windows but this is not currently supported.
Installing into a self-contained conda environment
To avoid issues with package conflicts, it’s often best to work in self-contained environments. This example installs climlab and jupyter along with all their dependencies in a fresh environment:
conda create --name climlab-test --channel conda-forge climlab jupyter
conda activate climlab-test
Installing on Google Colab
The following code will install climlab and its dependencies on Google Colab:
!pip install -q condacolab
import condacolab
condacolab.install()
!conda install -c conda-forge climlab
Installing from source
You can clone the source code repository with:
git clone https://github.com/climlab/climlab.git
and from the climlab
directory, do:
python -m pip install . --no-deps -vv
Please see Contributing to CLIMLAB for more details.
About the compiled Fortran components
Climlab itself is pure Python and should work on any system. As of version 0.8.0, all the Fortran code has been moved into external companion packages:
If you install climlab via conda-forge, these pre-compiled dependencies will be installed automatically.
It is possible to install and run climlab without the compiled dependencies. In this case you should then find that you can still:
import climlab
and use parts of the package that don’t depend on compiled code. You will see warning messages about the missing components.
Source Code
Stables releases as well as the current development version can be found on github:
Dependencies
These are handled automatically if you install with conda.
Python (currently testing on versions 3.10, 3.11, 3.12, 3.13)
numpy
scipy
pooch (for remote data access and caching)
xarray (for data handling)
numba (used for acceleration of some components)
pytest (to run the automated tests, important if you are developing new code)
Anaconda Python is highly recommended and will provide everything you need. See “Installing pre-built binaries with conda” above.