Installation¶
PyTerrier is a declarative platform for building information retrieval pipelines and conducting experiemnts in Python.
Pre-requisites¶
PyTerrier requires Python 3.9 or newer. Java 11 or newer is required for some functionality. PyTerrier is natively supported on Linux, Mac OS X and Windows.
Installation¶
Installing PyTerrier is easy - it can be installed from the command-line using pip:
pip install 'pyterrier[all]'
python-terrieris a shortcut forpyterrier[all]
If you want a minimal installation without optional dependencies, you can install just the core package:
pip install pyterrier
If you want the latest version of PyTerrier, you can install directly from the Github repository
pip install --upgrade git+https://github.com/terrier-org/pyterrier.git
Problems Installing? Check out the installation troubleshooting guide.
Running PyTerrier¶
Once installed, you can get going with PyTerrier just by importing it. It’s common to alias it as pt:
import pyterrier as pt
Optional: Check Java Installation
Java is required for some functionality in PyTerrier. If you want to check to make sure Java is installed and configured properly, you can run:
pt.java.init()
Note that it was previously required to run init() before using PyTerrier. This is no longer required.
Problems with Java? Check out the Java troubleshooting guide.