Installation Guide for SpaCon

This guide will walk you through setting up an isolated Python environment using conda and installing the necessary packages, including spacon, torch, and torch_geometric.


Prerequisites

Before you begin, ensure you have Anaconda or Miniconda installed on your system. If not, you can download it from the official Anaconda website.

You will also need an NVIDIA GPU with a driver that supports the version of CUDA you intend to use.

Step 1: Create a Conda Virtual Environment

First, create a new virtual environment to isolate our project dependencies. We will name this environment spacon-env. Open your terminal or Anaconda Prompt and execute the following command:

conda create --name spacon-env python=3.10

This command creates a new environment with Python 3.10. When prompted to proceed, type y and press Enter.

Once the environment is created, activate it:

conda activate spacon-env

Your terminal prompt should now be prefixed with (spacon-env).

Step 2: Install spacon

With the spacon-env environment activated, the first package we will install is spacon.

pip install spacon

Step 3: Install PyTorch

Next, we will install PyTorch.

Note: The PyTorch installation command depends on your Operating System, package manager (pip, conda), and desired CUDA version. The command below is just an example for torch==2.5.0 with CUDA 12.4.

It is highly recommended that you visit the official PyTorch website (previous versions) to find the correct installation command for your specific setup.

Example installation command:

pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124

Step 4: Install torch_geometric

After successfully installing PyTorch, you can install torch_geometric.

pip install torch_geometric

Step 5: Install torch_geometric Dependencies

Finally, we need to install the necessary dependencies for torch_geometric that are compatible with our specific PyTorch and CUDA versions.

Note: The URL specified with the -f flag must match your version of torch and CUDA.

Please refer to the official PyTorch Geometric installation documentation to find the correct URL for your build.

The URL https://data.pyg.org/whl/torch-2.5.0+cu124.html in the command below corresponds to torch-2.5.0 and cu124. You must adjust this URL according to your versions.

pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.5.0+cu124.html

Verification

To ensure that all packages have been installed correctly, you can run the following Python script:

import spacon
import torch
import torch_geometric

print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
if torch.cuda.is_available():
    print(f"CUDA version: {torch.version.cuda}")
print(f"torch_geometric version: {torch_geometric.__version__}")

You have now successfully set up your Python environment with all the required packages.