Installation#
There are many ways to install Pyxel. On this page we list the most common ones. In general we recommend to use virtual environments when using Pyxel. This ways you have full control over addition packages that you may use in your analysis and your work with well defined computing environments.
If you want to learn about using virtual environments see Virtual Environments. You can also install Pyxel for development.
Using Anaconda / Miniconda#
The easiest way to install Pyxel for Linux, MacOS and Windows is to install Anaconda or Miniconda Python distribution. The packages are available from the conda-forge.
Note
It is strongly encouraged to install Pyxel with conda
(or mamba
) rather than pip
because
of the optional dependency pygmo.
pygmo is exclusively used for the calibration mode.
See here for more information.
To install the latest stable version of Pyxel, execute this command in a terminal:
conda install -c conda-forge pyxel-sim
Note
It is recommended to install Pyxel in its own dedicated Conda environment. For more information, click here Conda Environments.
To update an existing installation you can use:
conda update pyxel-sim
Note
For now, it’s not possible to install a recent version of
lacosmic
for all platforms directly from conda
or mamba
.
The user must install lacosmic
manually (in the current conda environment) with the
command pip
:
pip install lacosmic
Using Mamba#
Alternatively, you can use Mamba for the installation.
Mamba is an alternative package manager that support most of conda’s command but offers
higher installation speed and more reliable environment solutions.
To install mamba
in the Conda base environment:
conda install mamba -n base -c conda-forge
then:
mamba install -c conda-forge pyxel-sim
Mamba supports of the commands that are available for conda.
So updating and installing specific versions works the same way
as above except for replacing the conda
with the mamba
command.
Note
For now, it’s not possible to install a recent version of
lacosmic
for all platforms directly from conda
or mamba
.
The user must install lacosmic
manually (in the current conda environment) with the
command pip
:
pip install lacosmic
Pip#
To install the latest Pyxel stable version (see Pyxel page on PyPi) using pip:
Full installation#
Note
It is recommended to install Pyxel in its own dedicated Python’s virtual environment. For more information, click here Venv Environments.
To install all optional dependencies of Pyxel, you must run the command:
pip install pyxel-sim[all] # Install everything (only on Linux !)
To install only the optional dependencies for the models, you can run:
pip install pyxel-sim[model] # Install all extra dependencies
# for models (poppy, lacosmic)
Warning
Library pygmo2
is only available for Linux on PyPi.
If you want to use the calibration mode on Windows or MacOS, you must
install Pyxel with conda
.
Updating#
To update Pyxel with pip
, you can use the following command:
pip install -U pyxel-sim
Install from source#
To install Pyxel from source, clone the repository from the Pyxel GitLab repository.
# Get source code
git clone https://gitlab.com/esa/pyxel.git
cd pyxel
python install -m pip install .
You can install all dependencies as well:
python -m pip install ".[all]"
Or do a developer install by using the -e flag (For more information see Creating a development environment from the page Contributing to Pyxel)
python -m pip install -e .
Verify the installation#
You can verify that Pyxel is installed with the following command:
python -c "import pyxel; pyxel.show_versions()"
Dependencies#
Required dependencies#
Pyxel has the following mandatory dependencies:
Optional dependencies#
Pyxel has many optional dependencies for specific functionalities.
If an optional dependency is not installed, Pyxel will raise an ImportError
when
the functionality requiring that dependency is called.
If using pip, optional pyxel dependencies can be installed as optional extras
(e.g. pyxel-sim[model,calibration]
).
All optional dependencies can be installed with pip install "pyxel-sim[all]"
,
and specific sets of dependencies are listed in the sections below.
Models dependencies#
Installable with pip install "pyxel-sim[model]"
.
Package |
Minimum version |
Notes |
---|---|---|
For model |
||
1.1.0 |
For models |
|
For model |
Note
Optional package
lacosmic is not available
on conda
, only on the PyPI
repository.
Calibration mode#
To use the calibration mode, you must use pip install "pyxel-sim[calibration]"
.
Package |
Minimum version |
---|---|
2.16.1 |
Extra data sources#
Installable with pip install "pyxel-sim[io]"
.