ImSwitch Installation on Mac and Windows

ImSwitch Installation Guide

This should give you a quick start on installing imswitch. Let’s use this thread to update this document over time and chase issues in terms of compatibility.

Installation Methods

Recommended Method: Using pip

  1. Install Mamba or Conda. If you use Conda, replace mamba with conda in the commands below.

  2. To install the latest version of ImSwitch, use one of the following commands:

    pip install https://github.com/openUC2/ImSwitch/archive/refs/heads/master.zip
    # or
    pip install ImSwitchUC2 # Note: This may be outdated
    

HINT: You can use these commands also to update it.

  1. If you plan to edit and modify ImSwitch, consider forking the openUC2/imswitch repository and working from your fork, or cloning the repository directly.

Creating Your Environment

  1. Create and activate your environment:

    mamba create -n imswitchhackathon python=3.9 -y
    mamba activate imswitchhackathon
    cd ~/Downloads
    git clone https://github.com/openUC2/imswitch
    cd imswitch
    

Installation for ARM64-based Macs (Recommended Method)

  1. Install dependencies and ImSwitch:

    pip install -r requirements-arm64.txt
    pip install -e . --no-deps
    python -m pip install pyqtgraph qdarkstyle
    

Alternative Installation Method (Not Recommended)

  1. Install dependencies and ImSwitch using Conda:

    conda install -c conda-forge napari pyqt -y
    python -m pip install https://gitlab.com/bionanoimaging/nanoimagingpack/-/archive/master/nanoimagingpack-master.zip
    python -m pip install -e .
    python -m pip install pyqtgraph qdarkstyle
    

Installation for Other Systems

  1. Install dependencies and ImSwitch:

    pip install -r requirements.txt
    python -m pip install -e . --no-deps
    

Troubleshooting

  1. If you encounter issues, try reinstalling PyQt5:

    pip install pyqt5 --force-reinstall
    

Launching ImSwitch

  1. Run the following command to launch ImSwitch:

    python -m imswitch
    
  2. Choose “Virtual Microscope” as the configuration.