# Setup Guide for DeepPurpose (Windows/CUDA 11.8) This guide reproduces the current working environment for `deeppurpose002.py` on Windows 10/11 with an NVIDIA GPU. ## 1. Prerequisites - **Python 3.10.x** (Required for compatibility with DGL and DeepPurpose) - **NVIDIA GPU** with drivers installed. ## 2. Create Virtual Environment Open PowerShell/Terminal in your project folder: ```powershell python -3.10 -m venv .venv .\.venv\Scripts\Activate ``` ## 3. Install PyTorch (CUDA 11.8) Install the specific CUDA-enabled version of PyTorch: ```powershell pip install torch==2.7.1+cu118 torchvision==0.22.1+cu118 torchaudio==2.7.1+cu118 --index-url https://download.pytorch.org/whl/cu118 ``` *(Note: If 2.7.1+cu118 is not available in the future, check pytorch.org for the compatible LTS version matching DGL)* ## 4. Install Deep Graph Library (DGL) DGL must match the CUDA version: ```powershell pip install dgl==2.2.1+cu118 -f https://data.dgl.ai/wheels/cu118/repo.html pip install dgllife ``` ## 5. Install Core Dependencies DeepPurpose and PyTDC (Therapeutics Data Commons): ```powershell pip install DeepPurpose PyTDC pip install git+https://github.com/bp-kelley/descriptastorus pip install pandas numpy matplotlib prettytable tensorboard lifelines scikit-learn ``` ## 6. Windows-Specific Fixes (Crucial) ### Fix A: PyTDC Dependency Issues (`tiledbsoma`, `cellxgene_census`) PyTDC tries to install `cellxgene_census`, which depends on `tiledbsoma`. On Windows, `tiledbsoma` often fails to build. **Solution:** If `pip install PyTDC` fails, manually install dependencies excluding the problematic ones, or create mock files if the code doesn't actually use them (PyTDC generally works without them for standard datasets like DAVIS/KIBA). ### Fix B: DGL GraphBolt DLL Error DGL 2.x includes "GraphBolt" which requires C++ DLLs that may be missing or incompatible on Windows. **Error:** `FileNotFoundError: ... graphbolt_pytorch_X.X.X.dll` **Solution:** 1. **Code Fix (Recommended):** Add this line to the **very top** of your Python script (before `import torch` or `import dgl`): ```python import os os.environ["DGL_DISABLE_GRAPHBOLT"] = "1" ``` 2. **Library Fix (Manual):** If the error persists, edit `.venv\Lib\site-packages\dgl\graphbolt\__init__.py` and comment out all imports to prevent it from loading. ## 7. Running the Script ```powershell python deeppurpose002.py ``` To force usage of a specific GPU encoding: ```powershell python deeppurpose002.py --drug_enc DGL_GCN --target_enc CNN --epochs 10 ```