Installation
We strongly recommend installing xscen in an Anaconda Python environment. Furthermore, due to the complexity of some packages, the default dependency solver can take a long time to resolve the environment. If mamba is not already your default solver, consider running the following commands in order to speed up the process:
conda install -n base conda-libmamba-solver conda config --set solver libmamba
If you don’t have pip installed, this Python installation guide can guide you through the process.
Official Sources
Because of some packages being absent from PyPI (such as xESMF), we strongly recommend installing xscen in an Anaconda Python environment.
xscen can be installed directly from conda-forge:
conda install -c conda-forge xscen
This is the preferred method to install xscen, as it will always install the most recent stable release.
Note
If you are unable to install the package due to missing dependencies, ensure that conda-forge is listed as a source in your conda configuration: conda config –add channels conda-forge!
If for some reason you wish to install the PyPI version of xscen into an existing Anaconda environment (not recommended), this can be performed with:
python -m pip install xscen
This will install the latest stable release from PyPI, but will not include xESMF and other packages that are not available on PyPI. Measures have been taken to ensure that xscen will not break if xESMF fails to import, but some functionalities will be disabled.
Development Installation (Anaconda + pip)
For development purposes, we provide the means for generating a conda environment with the latest dependencies in an environment-dev.yml file at the top-level of the Github repo.
The sources for xscen can be downloaded from the Github repo.
Download the source code from the Github repo using one of the following methods:
Clone the public repository:
git clone git@github.com:Ouranosinc/xscen.gitDownload the tarball:
curl -OJL https://github.com/Ouranosinc/xscen/tarball/main
Once you have a copy of the source, you can install it with:
conda env create -f environment-dev.yml conda activate xscen-dev make dev
If you are on Windows, replace the
make devcommand with the following:python -m pip install -e .[dev]If for some reason you wish to install the PyPI version of xscen into an existing Anaconda environment (not recommended if requirements are not met), only run the last command above.
When new changes are made to the Github repo, if using a clone, you can update your local copy using the following commands from the root of the repository:
git fetch git checkout main git pull origin main conda env update -n xscen-dev -f environment-dev.yml conda activate xscen-dev make dev
These commands should work most of the time, but if big changes are made to the repository, you might need to remove the environment and create it again.
Finally, in order to compile the translation catalogs, run the following command from the root of the repository:
python -m pip install -e . make translate