Set up Python¶
Install the easydiffraction distribution and import it as edi. The same
installation works in scripts, notebooks, and with python -m edi.
Install¶
Use CPython 3.12 or newer on macOS with Apple Silicon or Linux x86-64; Windows follows in a later release. The package comes from the v2026.11.0 release on GitHub; its dependencies come from PyPI.
Create a project and install Python:
pixi init edi-python
cd edi-python
pixi add "python>=3.12"
In pixi.toml, add the EasyDiffraction package index:
[pypi-options]
extra-index-urls = ["https://enhantica.github.io/edi-download/pypi/simple/"]
Then add the package and check it:
pixi add --pypi "easydiffraction==2026.11.0"
pixi run python -c "import easydiffraction as edi; print(edi.Project)"
pixi run python -m edi --help
To upgrade, run the same pixi add with the new release's version.
Create a virtual environment:
python -m venv .venv
Activate it with source .venv/bin/activate on macOS or Linux, or
.\.venv\Scripts\Activate.ps1 in Windows PowerShell. Then install and check:
python -m pip install "easydiffraction==2026.11.0" --extra-index-url https://enhantica.github.io/edi-download/pypi/simple/
python -c "import easydiffraction as edi; print(edi.Project)"
python -m edi --help
To upgrade, run the install command again with the new release's version.
Building edi from source is described in the contributor documentation.
In a notebook¶
Install and launch JupyterLab from the environment where you installed edi.
pixi add jupyterlab
pixi run jupyter lab
python -m pip install jupyterlab
python -m jupyterlab
Select the kernel for that environment when you open a notebook.