Installation
===========
PySlyde can be installed from PyPI or from source. This guide covers all installation methods and requirements.
Requirements
-----------
PySlyde requires Python 3.8 or higher and the following dependencies:
* `numpy `_ >= 1.20.0
* `opencv-python `_ >= 4.5.0
* `openslide-python `_ >= 1.1.0
* `pandas `_ >= 1.3.0
* `matplotlib `_ >= 3.3.0
* `seaborn `_ >= 0.11.0
* `scikit-image `_ >= 0.18.0
* `scipy `_ >= 1.7.0
* `lmdb `_ >= 1.2.0
* `einops `_ >= 0.4.0
* `h5py `_ >= 3.1.0
* `huggingface_hub `_ >= 0.10.0
* `tensorflow `_ >= 2.8.0
* `torch `_ >= 1.10.0
* `timm `_ >= 0.6.0
* `webdataset `_ >= 0.2.0
Installation from PyPI
---------------------
The easiest way to install PySlyde is using pip:
.. code-block:: bash
pip install pyslyde
This will install PySlyde and all its dependencies automatically.
Installation from Source
-----------------------
To install from source, clone the repository and install in development mode:
.. code-block:: bash
git clone https://github.com/gregoryverghese/PySlide.git
cd PySlide
pip install -e .
Development Installation
------------------------
For development work, install with development dependencies:
.. code-block:: bash
git clone https://github.com/gregoryverghese/PySlide.git
cd PySlide
pip install -e ".[dev]"
This includes additional tools for development:
* `pytest `_ - Testing framework
* `pytest-cov `_ - Coverage reporting
* `black `_ - Code formatting
* `flake8 `_ - Linting
* `mypy `_ - Type checking
* `pre-commit `_ - Git hooks
System Dependencies
------------------
Some dependencies may require system-level libraries:
Ubuntu/Debian:
^^^^^^^^^^^^^
.. code-block:: bash
sudo apt-get update
sudo apt-get install libopenslide-dev libgl1-mesa-glx libglib2.0-0
macOS:
^^^^^^
.. code-block:: bash
brew install openslide
Windows:
^^^^^^^^
For Windows, most dependencies are available as pre-compiled wheels. If you encounter issues with OpenSlide, you may need to install it manually from the `OpenSlide website `_.
Verifying Installation
---------------------
To verify that PySlyde is installed correctly, run:
.. code-block:: python
import pyslyde
print(pyslyde.__version__)
You should see the version number printed without any errors.
Troubleshooting
--------------
Common Installation Issues
^^^^^^^^^^^^^^^^^^^^^^^^^
1. **OpenSlide not found**: Make sure you have the system-level OpenSlide library installed.
2. **CUDA issues**: If you're using GPU acceleration, ensure you have the correct CUDA version installed for your PyTorch/TensorFlow version.
3. **Memory issues**: PySlyde works with large images, so ensure you have sufficient RAM (8GB+ recommended).
4. **Permission errors**: On some systems, you may need to use `pip install --user` or install with sudo.
Getting Help
-----------
If you encounter installation issues:
1. Check the `GitHub issues `_ for similar problems
2. Create a new issue with your system details and error messages
3. Contact the maintainer at gregory.verghese@gmail.com