Installation

This section provides a short guide on how to install required components of ViPErLEED.

Installing the ViPErLEED ImageJ plugins

The installation instructions for ImageJ and the ViPErLEED plugins can be found in the ViPErLEED ImageJ plugins section.

Installing Python

With the exception of the ViPErLEED ImageJ plugins, ViPErLEED requires a working Python installation. You can install Python using a package manager or as binary from the Python website.

Note

ViPErLEED requires Python 3.7 or newer, though we recommend using the latest available Python version.

We suggest Windows users to follow the notes in the official Python documentation: use the full installer, and include the Python Launcher for Windows.

Installing the ViPErLEED Python package

ViPErLEED is available on the Python Package Index (PyPI) and can be installed using the Python package manager pip. We recommend installing ViPErLEED in a virtual environment for easier dependency management. See also Using a Python virtual environment.

To install ViPErLEED from PyPI using pip, run

python -m pip install viperleed

in your terminal.[1]

This will install the latest version of ViPErLEED and all required dependencies. It will also automatically install the ViPErLEED command-line tools which can be called from the terminal using the viperleed command. The viperleed.calc package for LEED-I(V) calculation has also some non-Python dependencies that can be installed as described in Installing tensor-LEED dependencies.

If you want to also install the dependencies for running the ViPErLEED graphical user interface, which also allows you to measure LEED-I(V) data, run

python -m pip install viperleed[GUI]

in your terminal.

Windows Subsystem for Linux

To run viperleed.calc under Windows, we recommend using the Windows Subsystem for Linux (WSL), available starting from Windows 10. Running viperleed.calc natively on Windows is possible, but experimental and not recommended.

Note

The ViPErLEED graphical user interface, used, e.g., for acquiring LEED-I(V) measurements, runs natively on Windows, and does not require WSL.

Installing WSL may require enabling some “developer” features (especially on Windows 10). To this end, open the Run dialog (Win+R), type optionalfeatures, then press Enter. Make sure that Virtual Machine Platform and Windows Subsystem for Linux are selected in the Windows Features dialog. You may need to restart your computer after selecting them. Then, on the Microsoft Store, download your preferred Linux distribution (e.g., Ubuntu). Once your distribution is downloaded, you can install it by clicking on it. Follow the instructions in the terminal to create a new user (note: user names should be lowercase only). You can then start WSL by typing

wsl

in your terminal. You can find more information about WSL on the official instructions by Microsoft.

Using a Python virtual environment

A Python virtual environment is a confined workspace in which Python dependencies can be installed without affecting other components of the system. Several packages exist to create and manage virtual environments. We list short instructions for a few of them below.

venv

venv is not the most popular virtual-environment package, but has the advantage of being distributed as part of the Python standard library and thus requires no external dependencies.

Tip

It is a good idea to collect multiple virtual environments into one root directory of your choice. This makes it easier to switch between virtual environments later on.

To create a new virtual environment, navigate in your terminal to the path where you would like the virtual-environment to be saved:

cd <path/to/folder/where/virtual/environment/should/be/saved>
cd "<path\to\folder\where\virtual\environment\should\be\saved>"

Then, create a fresh virtual environment with

pythonX.Y -m venv <virtual_env_name>
py -X.Y -m venv <virtual_env_name>

where X.Y is the Python version of your choice. Note that this is the version of Python that will be available (via python, or, on Windows, also py) in the virtual environment just created.

Virtual environments must be activated before they can be used:

source "path/to/<virtual_env_name>/bin/activate"
call "path\to\<virtual_env_name>\Scripts\activate.bat"

To disable a virtual environment, call deactivate instead.