Skip to content

Commit

Permalink
docs: updating README and installation file with python versions and …
Browse files Browse the repository at this point in the history
…how to fix broken napari or jupyter
  • Loading branch information
shachafl committed Aug 8, 2024
1 parent ad19b97 commit aba1a70
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ See `spacetx-starfish.readthedocs.io <https://spacetx-starfish.readthedocs.io/en
Installation
------------

starfish supports python 3.7 and above and can easily be installed from PyPI:
starfish supports python 3.8-11 and can easily be installed from PyPI:

.. code-block:: bash
$ pip install starfish[napari]
`For more detailed installation instructions, see here <https://spacetx-starfish.readthedocs.io/en/latest/installation/>`_.
`Some operating systems might need different dependencies for napari. For more detailed installation instructions, see here <https://spacetx-starfish.readthedocs.io/en/latest/installation/>`_.

Python Version Notice
---------------------

starfish will be dropping support for python 3.6 in the next release due to
minimum python=3.7 version requirements in upstream dependencies.
starfish will be dropping support for python 3.8 in the next release due to
minimum python=3.9 version requirements in upstream dependencies.

Contributing
------------
Expand Down
72 changes: 59 additions & 13 deletions docs/source/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

Starfish supports python 3.6 and above (python 3.7 recommended). To install the starfish package,
Starfish supports python 3.8-11. To install the starfish package,
first verify that your python version is compatible. You can check this by running :code:`python
--version`.

Expand All @@ -12,13 +12,13 @@ The output should look similar to this:
.. code-block:: bash
$ python --version
Python 3.7.7
Python 3.8.18
.. warning::
While starfish itself has no known issues with python 3.8, scikit-image is not fully
compatible with python 3.8. As such, installation of scikit-image, as part of starfish
installation, may unexpectedly fail. The workaround is to install numpy first before
installing starfish or scikit-image.
While starfish itself should work on any operating system, some napari dependencies might not be
compatible with Apple Silicon or Windows. As such, installation of napari, as part of starfish[napari]
installation, may unexpectedly fail. The workaround is to install napari first before
installing starfish or updating the dependencies via cloning the project and working in development mode.


Using virtual environments
Expand All @@ -44,7 +44,7 @@ Conda_ users can set one up like so:

.. code-block:: bash
$ conda create -n starfish "python=3.7"
$ conda create -n starfish "python=3.8"
$ conda activate starfish
Installing *starfish*
Expand All @@ -57,7 +57,7 @@ Starfish can easily be installed using pip:
$ pip install starfish
.. note::
If using python 3.8, first install numpy using pip before installing starfish.
If using Windows or Apple Silicon (M1+), first install napari using pip before installing starfish.

To use napari for interactive image visualization via :py:func:`.display` you must also
install napari:
Expand All @@ -72,8 +72,8 @@ Interactive visualization with napari also requires using Qt (e.g. by running th
Installing *starfish* on Windows
--------------------------------

Windows users can install starfish in the same way. Again, we recommend using a conda or virtual
environment with python 3.7. Here is how you would install starfish in a virtual environment
Windows (cmd.exe) users can install starfish in the same way. Again, we recommend using a conda or virtual
environment with python 3.8+. Here is how you would install starfish in a virtual environment
created with python's ``venv`` module:

.. code-block:: bat
Expand All @@ -82,12 +82,11 @@ created with python's ``venv`` module:
> cd starfish
> python -m venv .venv
> .venv\Scripts\activate.bat
> pip install napari[all]
> pip install starfish
> pip install starfish[napari]
.. note::
Python 3.8 has trouble installing scikit-image v0.15.0 and the ``pip install numpy``
workaround does not solve this issue on Windows.
If you encounter issues, you need to update the dependencies via cloning the project and working in development mode.

Jupyter notebook
----------------
Expand All @@ -97,7 +96,54 @@ the virtualenv kernel to jupyter by activating your virtual environment and then

.. code-block:: bash
$ python -m pip install jupyter
$ python -m ipykernel install --user --name=<venv_name>
Now you should be able to select ``venv_name`` as the kernel in a jupyter notebook to have access
to the starfish library.

Installing *starfish* in development mode
-----------------------------------------

If you need to resolve dependency issues with napari and jupyter or want to tinker with the
starfish package, it is best to work in development mode.
If you are on a mac, make sure you have the `XCode CommandLine Tools`_
installed.

.. _`XCode CommandLine Tools`: https://developer.apple.com/library/archive/technotes/tn2339/_index.html

Check out the code for starfish:

.. code-block:: bash
$ git clone https://github.com/spacetx/starfish.git
$ cd starfish
Set up a `virtual environment`_:

.. _`virtual environment`: #using-virtual-environments

.. code-block:: bash
$ python -m venv .venv
$ source .venv/bin/activate
Install starfish:

.. code-block:: bash
$ make install-dev
Update dependencies for napari and jupyter:

.. code-block:: bash
$ make -B requirements/REQUIREMENTS-NAPARI-CI.txt
$ make -B requirements/REQUIREMENTS-JUPYTER.txt
Install napari and jupyter:

.. code-block:: bash
$ pip install -r requirements/REQUIREMENTS-NAPARI-CI.txt
$ pip install -r requirements/REQUIREMENTS-JUPYTER.txt

0 comments on commit aba1a70

Please sign in to comment.