Installation¶
Tinify supports Python 3.8+ and PyTorch 1.7+.
From PyPI¶
The simplest way to install Tinify is via pip:
Note
Pre-built wheels are available for Linux and macOS.
From Source¶
For development or to get the latest features, install from source.
Prerequisites¶
- A C++17 compiler (GCC 7+, Clang 5+, or MSVC 2019+)
- pip 19.0+
- Python 3.8+
Installation Steps¶
-
Clone the repository:
-
Install in development mode:
Optional Dependencies¶
Install additional packages for specific use cases:
Using uv¶
For faster dependency resolution with uv:
Or from source:
Verifying Installation¶
After installation, verify that Tinify is working:
import tinify
print(tinify.__version__)
# List available entropy coders
print(tinify.available_entropy_coders())
# List available models
from tinify.zoo import models
print(models.keys())
Docker¶
Docker images are planned for future releases.
Warning
Conda environments are not officially supported.
Troubleshooting¶
Build Errors¶
If you encounter build errors related to C++ extensions:
- Ensure you have a C++17 compatible compiler installed
- Update pip:
pip install -U pip -
Try installing with
--no-build-isolation:
CUDA Issues¶
For GPU support, ensure you have:
- CUDA toolkit installed (compatible with your PyTorch version)
- cuDNN installed