Installation
From Package Manager (Recommended)
pyclesperanto is available on PyPI and conda-forge, and can be installed via pip or conda. It is recommended to install it via a package manager to ensure that all dependencies are correctly installed.
Install from PyPI with pip:
pip install pyclesperanto
Install from conda-forge with conda or mamba:
conda install -c conda-forge pyclesperanto
Note
It is strongly advised to install pyclesperanto in a virtual environment. For example, you can create a new environment with conda:
conda create --name myenv
conda activate myenv
Warning
Installing pyclesperanto with mamba or conda on MacOS or Linux will require an additional package to be installed to see compatible OpenCL platforms.
conda install -c conda-forge ocl_icd_wrapper_apple
conda install -c conda-forge ocl-icd-system
From Source
Alternatively, you can install the package from source on your system. This is not advised unless you are planning to contribute to the development of the package, test new features, or debug issues. We strongly recommend using a virtual environment to install the package from source.
Run the following commands in your terminal to install the package from source:
git clone https://github.com/clEsperanto/pyclesperanto.git
cd pyclesperanto
pip install .
Note
You can add the flag -v
to enable verbose output of the build process.
Warning
The -e
flag is advised if you are planning to contribute to the development of the package.
pyclesperanto should now be installed as a package along with all its dependencies. You can now start using it in your Python scripts and test modifications to the source code. However, any modification of the source code will require you to re-install the package with pip to take effect.
Troubleshooting
In case of error messages such as "No OpenCL platform found"
, you may need to install the OpenCL drivers for your system or "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR"
,
you may need to install more recent drivers for your GPU or you may be missing some specific libraries.
If you have issues, contact us for help on the image.sc forum or create an issue on the GitHub repository.