Installing NeuroLang#
NeuroLang requires Python ≥ 3.8. The recommended way to install it is
with uv — a fast Python package manager —
or with standard pip.
1. Install uv
Open PowerShell and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Or use pip directly if you already have Python installed:
pip install uv
2. Install NeuroLang
uv pip install neurolang
3. Verify
Open a new terminal and run:
python -c "import neurolang; print('NeuroLang installed OK')"
1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Install NeuroLang
uv pip install neurolang
3. Verify
python -c "import neurolang; print('NeuroLang installed OK')"
1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Install NeuroLang
uv pip install neurolang
3. Verify
python -c "import neurolang; print('NeuroLang installed OK')"
Clone the repository and install in editable mode with all dev and doc dependencies:
git clone https://github.com/NeuroLang/NeuroLang.git
cd NeuroLang
uv pip install -e ".[dev,doc]"
To update your local copy:
git pull
uv pip install -e ".[dev,doc]"
Verify:
python -c "import neurolang; print('NeuroLang installed OK')"
Using pip without uv#
If you prefer plain pip:
pip install neurolang
Dependencies#
NeuroLang requires the following libraries (installed automatically):
Installing alternative backends for Neurolang#
By default, Neurolang uses the pandas library to manage its data. It is however possible to use an alternative backend which relies on dask-sql.
Using the dask-sql backend allows Neurolang to benefit from some query optimizations based on SQL syntax, as well as parallelism in computation by using dask instead of pandas. In other words, using the dask-sql backend might help improve the performance of specific queries which are slow to resolve with the default installation of Neurolang. It is not however guaranteed to be faster, as query optimizations are very case specific…
To install Neurolang with the dask-sql backend, it is required to first install a version of the maven library along with a running java installation with version >= 8 (dask-sql needs Java for parsing the SQL queries). There are two ways to install maven along with java:
On a linux machine, run the following command in your shell terminal:
sudo apt update && sudo apt install maven
Or, if you’re using conda to manage your python environments, you can run the following command in your active python environment:
conda install -c conda-forge maven
Once you’ve setup your machine with a working version of java and maven, you can install Neurolang with the dask-sql backend by running the following command in your active python environment from a local copy of the Neurolang repository:
pip install -U --user neurolang[dask]
Finally, to enable the dask-sql backend for Neurolang, you can either edit Neurolang’s configuration file located in your python environment path under config/config.ini, or you can call
from neurolang.config import config
config.set_query_backend("dask")
from your python shell.
Note: you need to call the set_query_backend method at the top of your script, before you import other modules from Neurolang.