How to install GQLAlchemy
There are two main ways of installing GQLAlchemy: with package managers such as pip and Poetry, and by building it from source.
Prerequisites
To install GQLAlchemy, you will need the following:
- Python 3.8 - 3.10
- GQLAlchemy is built on top of Memgraph's low-level Python client
pymgclient
, so you need to installpymgclient
build prerequisites.
Install with pip
After you’ve installed the prerequisites, run the following command to install GQLAlchemy:
pip install gqlalchemy
With the above command, you get the default GQLAlchemy installation which doesn’t include import/export support for certain formats (see below). To get additional import/export capabilities, use one of the following install options:
pip install gqlalchemy[arrow] # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
pip install gqlalchemy[dgl] # DGL support (also includes torch)
pip install gqlalchemy[all] # All of the above
Build from source
Clone or download the GQLAlchemy source code locally and run the following command to build it from source with Poetry:
poetry install --all-extras
The poetry install --all-extras
command installs GQLAlchemy with all extras
(optional dependencies). Alternatively, you can use the -E
option to define
what extras to install:
poetry install # No extras
poetry install -E arrow # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
poetry install -E dgl # DGL support (also includes torch)
To run the tests, make sure you have an active Memgraph instance, and execute one of the following commands:
poetry run pytest . -k "not slow" # If all extras installed
poetry run pytest . -k "not slow and not extras" # Otherwise
If you’ve installed only certain extras, it’s also possible to run their associated tests:
poetry run pytest . -k "arrow"
poetry run pytest . -k "dgl"