Skip to content

Commit 2122f97

Browse files
shaneahmedJohn-Pmostafajahanifar
authored
📝 DOC: Improve Installation Instructions (#567)
- Improve installation instructions --------- Co-authored-by: John Pocock <[email protected]> Co-authored-by: Mostafa Jahanifar <[email protected]>
1 parent 6388513 commit 2122f97

File tree

2 files changed

+58
-50
lines changed

2 files changed

+58
-50
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ tiatoolbox supports various features through command line. For more information,
8585

8686
Prepare a computer as a convenient platform for further development of the Python package `tiatoolbox` and related programs as follows.
8787

88-
1. Install [pre-requisite software](https://tia-toolbox.readthedocs.io/en/latest/installation.html)
88+
1. Install [pre-requisite software](https://tia-toolbox.readthedocs.io/en/latest/installation.html#prerequisites)
8989
1. Open a terminal window<br/>
9090

9191
```sh
@@ -107,16 +107,16 @@ Prepare a computer as a convenient platform for further development of the Pytho
107107
5. Create virtual environment for TIAToolbox using
108108

109109
```sh
110-
$ conda env create -f requirements.dev.conda.yml # for linux/mac only.
110+
$ conda create -n tiatoolbox-dev python=3.8 # select version of your choice
111111
$ conda activate tiatoolbox-dev
112+
$ pip install -r requirements_dev.txt
112113
```
113114

114115
or
115116

116117
```sh
117-
$ conda create -n tiatoolbox-dev python=3.8 # select version of your choice
118+
$ conda env create -f requirements.dev.conda.yml # for linux/mac only.
118119
$ conda activate tiatoolbox-dev
119-
$ pip install -r requirements_dev.txt
120120
```
121121

122122
6. To use the packages installed in the environment, run the command:

docs/installation.rst

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,26 @@ Installation
44
************
55

66
Prerequisites
7-
--------------
7+
=============
88
The prerequisites for tiatoolbox installation are OpenSlide binaries and OpenJpeg version 2.3.0 or above.
99
Please follow the instructions below to install prerequisite software according to the platform you are using.
1010

11-
Using Anaconda (Recommended)
12-
============================
13-
14-
After `installing Anaconda <https://docs.anaconda.com/anaconda/install/index.html>`_ (or miniconda), you can install TIA toolbox using the following command:
11+
Linux (Ubuntu)
12+
--------------
13+
On Linux the prerequisite software can be installed using the command
1514

1615
.. code-block:: console
1716
18-
$ conda install -c conda-forge tiatoolbox
19-
20-
Please note that conda-forge installation support is limited on Windows as openslide binaries are not supported on official conda channels. An alternate way to install using conda on Windows could be to install it in `WSL2 with CUDA support <https://docs.microsoft.com/en-us/windows/ai/directml/gpu-cuda-in-wsl>`_. In some cases, WSL2 runs faster on Python codes and therefore we **recommend** this option.
21-
22-
Alternative Method
23-
==================
17+
$ apt-get -y install libopenjp2-7-dev libopenjp2-tools openslide-tools
2418
25-
If you cannot use Anaconda or are having trouble with it, you can try an alternative install method. We will install prerequisite binary packages and then use pip (the Python package manager) to install python dependencies.
19+
The same command is used when working on the Colab or Kaggle platforms.
20+
When working on Google Colab, we remove the packages ``datascience`` and ``albumentations`` because they conflict
21+
and produce an error message.
2622

27-
Windows
28-
^^^^^^^
23+
Windows (10+)
24+
-------------------
2925
1. Download OpenSlide binaries from `this page <https://openslide.org/download/>`_. Extract the folder and add ``bin`` and ``lib`` subdirectories to
30-
Windows `system path <https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)>`_.
26+
Windows `system path <https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)>`_. If you are using a conda environment you can also copy ``bin`` and ``lib`` subdirectories to ``[Anaconda Installation Path]/envs/[tiatoolbox-environment]/Library/``.
3127

3228
2. Install OpenJPEG. The easiest way is to install OpenJpeg is through conda
3329
using
@@ -36,73 +32,83 @@ using
3632
3733
C:\> conda install -c conda-forge openjpeg
3834
39-
3. Install
40-
TIAToolbox.
41-
42-
.. code-block:: console
43-
44-
C:\> pip install tiatoolbox
45-
46-
Linux (Ubuntu)
47-
^^^^^^^^^^^^^^
48-
On Linux the prerequisite software can be installed using the command
49-
50-
.. code-block:: console
51-
52-
$ apt-get -y install libopenjp2-7-dev libopenjp2-tools openslide-tools
53-
54-
The same command is used when working on the Colab or Kaggle platforms.
55-
When working on Google Colab, we remove the packages ``datascience`` and ``albumentations`` because they conflict
56-
and produce an error message.
57-
5835
macOS
59-
^^^^^
36+
-----
6037

6138
On macOS there are two popular package managers, `homebrew`_ and `macports`_.
6239

6340
.. _homebrew: https://brew.sh/
6441
.. _macports: https://www.macports.org/
6542

6643
Homebrew
67-
""""""""
44+
^^^^^^^^
6845

6946
.. code-block:: console
7047
7148
$ brew install openjpeg openslide
7249
7350
MacPorts
74-
""""""""
51+
^^^^^^^^
7552

7653
.. code-block:: console
7754
7855
$ port install openjpeg openslide
7956
8057
81-
Stable release
82-
--------------
58+
Installing Stable Release
59+
=========================
8360

8461
Please note that TIAToolbox is tested for python version 3.8, 3.9 and 3.10.
85-
To install TIA Toolbox, run this command in your terminal after you have installed the prerequisite software:
62+
63+
Recommended
64+
-----------
65+
To install TIAToolbox, run this command in your terminal after you have installed the prerequisite software:
8666

8767
.. code-block:: console
8868
8969
$ pip install tiatoolbox
9070
9171
This is the preferred method to install TIA Toolbox, as it will always install the most recent stable release.
9272

73+
Upgrade
74+
-------
75+
9376
To upgrade an existing version of tiatoolbox to the latest stable release, run this command in your terminal:
9477

9578
.. code-block:: console
9679
9780
$ pip install --ignore-installed --upgrade tiatoolbox
9881
82+
Without Dependencies
83+
--------------------
84+
85+
If you already have setup a Python environment with all the pre-requisite software and dependencies installed and you would like to keep the existing versions of these dependencies, run this command in your terminal:
86+
87+
.. code-block:: console
88+
89+
$ pip install --no-deps tiatoolbox
90+
9991
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
10092
you through the process.
10193

10294
.. _pip: https://pip.pypa.io
10395
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
10496

10597

98+
Alternative Method(s)
99+
=====================
100+
101+
Using Anaconda
102+
--------------
103+
104+
After installing `Anaconda <https://docs.anaconda.com/anaconda/install/index.html>`_ (or `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ / `mamba <https://mamba.readthedocs.io/en/latest/user_guide/mamba.html#mamba-vs-conda-clis>`_), you can install TIAToolbox using the following command:
105+
106+
.. code-block:: console
107+
108+
$ conda install -c conda-forge tiatoolbox
109+
110+
Please note that conda-forge installation support is limited on Windows as openslide binaries are not supported on official conda channels. An alternate way to install using conda on Windows could be to install it in `WSL2 with CUDA support <https://docs.microsoft.com/en-us/windows/ai/directml/gpu-cuda-in-wsl>`_. In some cases, WSL2 runs faster on Python codes and therefore we **recommend** this option.
111+
106112
From sources
107113
------------
108114

@@ -131,22 +137,24 @@ Once you have a copy of the source, you can install it with:
131137
.. _tarball: https://github.com/TissueImageAnalytics/tiatoolbox/tarball/master
132138

133139
Using Docker
134-
============
140+
------------
135141

136142
To run TIA toolbox in an isolated environment, use our `Docker image <https://github.com/tissueimageanalytics/tiatoolbox-docker/pkgs/container/tiatoolbox>`_ . We host different Dockerfiles in our github repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_. Please report any issues related to the docker image in the repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_.
137143

138144
After `installing Docker <https://docs.docker.com/get-docker/>`_ (or Docker Desktop), you can use our TIA toolbox image in 3 different ways.
139145

140-
Use the pre-built docker image
146+
Use the Pre-Built Docker Image
141147
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142-
1. Pull the image from the Github Container Registry
143-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148+
TIAToolbox provides pre-built docker containers which can be downloaded using the instructions below:
149+
150+
1. Pull the Image From Github Container Registry
151+
""""""""""""""""""""""""""""""""""""""""""""""""""""
144152
.. code-block:: console
145153
146154
$ docker pull ghcr.io/tissueimageanalytics/tiatoolbox:latest
147155
148-
2. Use the pre-built Docker image as a base image in a Dockerfile
149-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156+
2. Use the Pre-Built Docker Image as a Base Image in a Dockerfile
157+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
150158
.. code-block:: console
151159
152160
$ FROM ghcr.io/tissueimageanalytics/tiatoolbox:latest

0 commit comments

Comments
 (0)