Installation
Installation Using pip or conda
DeepGraph can be installed via pip from PyPI:
$ pip install deepgraph
To install with optional dependencies (i.e. “extras”, extending the base functionality of DeepGraph), use:
$ pip install deepgraph[plot,basemap,tables,scipy,networkx]
or simply use:
$ pip install deepgraph[all]
to install all optional dependencies. Extras and their added functionality are described below.
Note
There is one optional dependency that can not (yet) be install via pip: graph-tool. Please refer to the linked project homepage for recommended installation.
Alternatively, if you’re using Conda, install with:
$ conda install -c conda-forge deepgraph
It is not possible to specify optional dependencies (“extras”) directly when installing a Python package using conda. To enable the extra features of deepgraph, you have to manually add the corresponding packages to your conda environment.
For example, if you want to use features that require “scipy”, you would need to install scipy separately using:
$ conda install scipy
To install deepgraph including all optional dependencies, you could also use an environment.yml file, e.g.
name: deepgraph-env
channels:
- conda-forge
dependencies:
- python>=3.9
- numpy>=1.21.6
- pandas>=1.2
- matplotlib>=3.1
- basemap>=2.0
- pytables>=3.7
- scipy>=1.5.4
- networkx>=2.4
- graph-tool>=2.27
- deepgraph
Then create the environment with:
$ conda env create -f environment.yml
and activate it via:
$ conda activate deepgraph-env
Installation from Source & Environment Setup
DeepGraph uses uv to manage the package. To get started as a developer, follow the instructions below
- Install uv
If you haven’t already, install uv by following the official instructions:
$ curl -Ls https://astral.sh/uv/install.sh | sh
- Clone the repository
Use git to clone the repository and cd into it:
$ git clone https://github.com/deepgraph/deepgraph.git $ cd deepgraph
- Set up the development environment
Use uv to create and manage your virtual environment:
$ uv syncThis will create a virtual environment, install the required and the developer dependencies, build the DeepGraph package and install it in editable mode.
- Installing with optional dependencies (“extras”)
To install extras (i.e. optional dependencies, extending the core functionality of DeepGraph), use the following command:
$ uv sync --extra <EXTRA>
- where <EXTRA> can be one of
tables
scipy
networkx
plot
basemap
To install all optional dependencies, simply use:
$ uv sync --all-extras
- Run tests
To run tests, use the following command:
$ uv run pytest .
- Build the documentation
To build the documentation, run the following commands:
$ cd doc $ make html
Dependencies
Package |
Minimum supported version |
|---|---|
3.9 |
|
1.21.6 |
|
1.2 |
It is highly recommended to install Pandas’ optional dependencies. In particular, it is recommended to install the performance dependencies.
Optional Dependencies / Extras
The following are recommended packages that DeepGraph can use to provide additional functionality.
Dependency |
Minimum Version |
pip extra |
Notes |
|---|---|---|---|
3.1 |
plot |
Used by the plotting methods of DeepGraph. |
|
2.0 |
basemap |
Used by |
|
3.7 |
tables |
Necessary for HDF5-based storage of pandas DataFrames. A |
|
1.5.4 |
scipy |
Used by |
|
2.4 |
networkx |
Used by |
|
2.27 |
N/A |
Used by |