# Installing ISIS on Windows using WSL

**URL:** <https://openplanetary.discourse.group/t/installing-isis-on-windows-using-wsl/781>\
**Category:** Python\
**Tags:** isis\
**Created:** [April 24, 2024, 1:12pm UTC](https://openplanetary.discourse.group/t/installing-isis-on-windows-using-wsl/781 "2024-04-24T13:12:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toIhr](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@toIhr](https://openplanetary.discourse.group/u/toIhr)\
**Post date:** [April 24, 2024, 1:12pm UTC](https://openplanetary.discourse.group/t/installing-isis-on-windows-using-wsl/781/1 "2024-04-24T13:12:21Z")

</div>

During the installation of a complicated Science Stack I had the necessity to install the ISIS package [link](https://github.com/DOI-USGS/ISIS3) on my Windows machine. While it probably is the easiest to develop most applications with Linux, some people have different good reasons to work with Windows even if some things become more complicated.

In the following I will outline how to install ISIS on a Windows 11 machine using WSL 2, in theory this should also work at the very least similar if not exactly the same on Windows 10 for those that have yet to upgrade to Windows 11, or maybe are barred due to the Minimum Requirements.

I will not go into details on how to install WSL as this is outlined by Microsoft [here](https://learn.microsoft.com/en-us/windows/wsl/install) much better than I could ever do myself. I will only say that I am using WSL 2, which is required if you want to use any of ISIS’ GUI tools, and Ubuntu 22.04 LTS.

Now that we are started we open WSL in the Windows Terminal or from the CMD with the command:

```cmd
wsl

```

Then our WSL distro should open and you should have the corresponding shell opened.

We then go over to install miniforge (or alternatively mambaforge)

```bash
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh

```

Once we have miniforge installed, we can basically follow the instructions to install ISIS step by step as the WSL environment behaves nigh identical to a normal Linux install.

Thus we start by creating our ISIS conda environment:

```bash
conda create -n isis python=3.9 

```

this is the conda environment that will only be used to install isis and do nothing else, as anything else done in this environment might potentialy break the isis install.

```bash
conda activate isis

```

after activating the isis environment we add the usgs astrogeology channel, and the conda-forge channel, as we use miniforge the conda-forge channel should already be installed.

```bash
conda config --env --add channels conda-forge #only needed when not using miniforge/mambaforge
conda config --env --add channels usgs-astrogeology

```

To ensure we have the correct channels set we verify by:

```bash
conda config --show channels

```

where we expect to see:

```auto
 channels:
    - usgs-astrogeology
    - conda-forge

```

It is important that the usgs-astrogeology channel is 1st and the conda-forge channel is 2nd IF: this is not the case please rerun the following:

```bash
conda config --env --add channels usgs-astrogeology

```

and lastly we need to set the channel priority to flexible:

```bash
conda config --env --set channel_priority flexible

```

Now we have set all the prerequisites for installing ISIS, here is were we differ a little bit from the ISIS package install instructions, for the sake of our sanity. Since TODO miniforge bundles in the much faster solver mamba to conda which we will use to install ISIS, within much less than the 1-2 hours outlined by the install instructions:

```bash
mamba install -c usgs-astrogeology isis

```

after the install has finished we only have to setup the environment variables such that ISIS can find them within the conda environment:

```bash
conda env config vars set ISISROOT=$CONDA_PREFIX ISISDATA=[path to data directory]

```

now you only need to reactivate the conda environment for the environment variables to be set

```bash
conda activate isis

```

Now we have finished installing ISIS into Windows WSL now to check if everything is working well, we can try to run the `qview` command from within the `isis` environment. This should take a moment and we should be able to see the following window:

 ![Pasted image 20240419151538](https://global.discourse-cdn.com/free1/uploads/openplanetary/original/1X/18989bab4d38bb1e1ead1d992ae7078b9bed1d7e.png)

---

<div class="post-metadata">

**Author:** ![toIhr](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@toIhr](https://openplanetary.discourse.group/u/toIhr)\
**Post date:** [April 25, 2024, 2:56pm UTC](https://openplanetary.discourse.group/t/installing-isis-on-windows-using-wsl/781/2 "2024-04-25T14:56:25Z")

</div>

Additionaly you want to potentialy use the ISIS tools in combination with other tools from python or similar without breaking the ISIS install.

This can be done by creating a new conda environment:

```bash
conda create -n science  
conda activate science

```

and then adding 3 environment Variables:

the previously set ISISROOT and and ISISDATA

```bash
conda env config vars set ISISROOT=[ISISROOT path from isis env] ISISDATA=[path to data directory]

```

where the ISISROOT needs to point to the ISISROOT path from the isis environment.

Lastly you want to add the path to the binaries to the path variables

```bash
export PATH=$PATH:$ISISROOT/bin

```

this needs to be reset every time you reopen your shell otherwise you want to add it to your **/etc/bash.bashrc** file for it to be activated in every bash shell.
