Freate16 commited on
Commit
58f623a
·
1 Parent(s): cc2dd96

Fix PyTorch pip dependency sequence

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -24,14 +24,16 @@ RUN apt-get update && apt-get install -y \
24
  && rm -rf /var/lib/apt/lists/*
25
  USER user
26
 
27
- # Copy requirements and install via standard pip
28
- # (Pip handles Linux wheels perfectly, unlike Windows where Conda is needed)
29
- COPY --chown=user:user requirements.txt .
30
- RUN pip install --no-cache-dir --user -r requirements.txt
31
 
32
- # Install PyTorch Geometric dependencies (Sparse/Scatter) for Linux CPU natively
33
  RUN pip install --no-cache-dir --user torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
34
 
 
 
 
 
35
  # Copy the rest of the application
36
  COPY --chown=user:user . .
37
 
 
24
  && rm -rf /var/lib/apt/lists/*
25
  USER user
26
 
27
+ # 1. Install PyTorch FIRST (Required for PyG C++ extensions)
28
+ RUN pip install --no-cache-dir --user torch==2.2.0+cpu torchvision==0.17.0+cpu -f https://download.pytorch.org/whl/cpu
 
 
29
 
30
+ # 2. Install PyTorch Geometric dependencies (Sparse/Scatter) natively from PyG wheel index
31
  RUN pip install --no-cache-dir --user torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
32
 
33
+ # 3. Copy requirements and install the rest (It will skip torch and torch-scatter since they are already installed)
34
+ COPY --chown=user:user requirements.txt .
35
+ RUN pip install --no-cache-dir --user -r requirements.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
36
+
37
  # Copy the rest of the application
38
  COPY --chown=user:user . .
39