Installation

Follow the steps below to install PyJAMAS.

  1. Install Python 3.10-3.13.

  2. We strongly recommend managing your PyJAMAS installation using uv (if you do not have uv, download and install it).

  3. Virtual environments allow isolation of Python packages, preventing interference and incompatibilities between different package dependencies and versions thereof. The easiest way to install PyJAMAS creating a self-contained installation that automatically (and transparently!!) opens and closes a virtual environment each time that you run PyJAMAS is with:

    $ uv tool install pyjamas-rfglab
    
  4. Alternatively, you can create a virtual environment with uv (but also with conda, venv, virtualenv, etc.):

    $ uv venv envpyjamas --python 3.11
    

    substituting 3.11 with the version of the Python interpreter that you would like to use, and envpyjamas with the path of the folder that will store the virtual environment. Note that the folder will be created if it did not exist.

    Next, activate the environment. In MacOS or Linux, use:

    $ source envpyjamas/bin/activate
    

    and in Windows:

    $ envpyjamas\\Scripts\\activate
    

    Please note that for Windows-based systems we STRONGLY recommend using the Windows Subsystem for Linux (WSL), and then you can follow the Linux instructions and spare yourself a world of pain.

  5. Download and install PyJAMAS:

    $ uv pip install pyjamas-rfglab
    

    Or if you are using not using uv (see below):

    $ python -m pip install pyjamas-rfglab
    

Using GPUs

PyJAMAS supports the use of the GPU on Mac Silicon chips, as well as CUDA-enabled GPUs on PCs using the WSL or Linux.

Running PyJAMAS

To run PyJAMAS, open a terminal and type:

$ pyjamas

PyJAMAS can be run from the source code (which can be downloaded at https://bitbucket.org/rfg_lab/pyjamas) by opening a terminal, navigating to the folder that contains the code, and typing:

$ python -m pyjamas.pjscore

Known problems

GENERAL

  • The analysis of image batches in PyJAMAS can generate interactive Jupyter notebooks. Interactivity in Jupyter notebooks relies on ipywidgets, a package installed with PyJAMAS. Please, check the ipywidgets documentation if you have issues with interactivity in notebooks (e.g. there are no interactive features). Most often the following steps are sufficient to fix any issues:

    1. Download and install the Nodejs JavaScript runtime.

    2. Open a new terminal and execute the following command for JupyterLab:

    $ jupyter labextension install @jupyter-widgets/jupyterlab-manager
    

    or this one for Jupyter Notebook:

    $ jupyter nbextension enable --py widgetsnbextension
    
    1. Reopen your Jupyter server.

MACOS

  • PyJAMAS uses PyQt6 to create a cross-platform user interface, but PyQt6 does not play well with MacOS Catalina or earlier MacOS versions. If you are using an old MacOS and cannot upgrade, you can still use the last version of PyJAMAS written with PyQt5:

$ python -m pip install pyjamas-rfglab==2023.8.0

WINDOWS

  • If you are not using the WSL, certain imports can cause problems. For example, import skimage can cause the following error: “ImportError: DLL load failed while importing _rolling_ball_cy: The specified module could not be found.”. To fix this error:

    1. The error happen because the system is missing the Microsoft C and C++ runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.

    2. Download and install the Microsoft C and C++ runtime libraries by running vcredist_x64.exe (https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).

LINUX

  • In Linux systems, you will need permissions to install PyJAMAS globally. To restrict the PyJAMAS installation to the current user, install it with:

$ python –m pip install --user --no-cache-dir -U pyjamas-rfglab