Spaces:
Build error
Build error
Fix ImportError: libgthread-2.0.so.0 by installing libglib2.0-0
Browse files- Dockerfile +3 -4
Dockerfile
CHANGED
@@ -15,11 +15,13 @@ WORKDIR /app
|
|
15 |
# Install essential system dependencies required for Miniconda and general build processes.
|
16 |
# This includes wget for downloading, git for cloning (if needed), build-essential for compiling,
|
17 |
# and libgl1-mesa-glx for graphics-related libraries often used by ML frameworks.
|
|
|
18 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
19 |
wget \
|
20 |
git \
|
21 |
build-essential \
|
22 |
libgl1-mesa-glx \
|
|
|
23 |
# Clean up apt cache to reduce image size
|
24 |
&& rm -rf /var/lib/apt/lists/*
|
25 |
|
@@ -51,9 +53,7 @@ ENV CONDA_DEFAULT_ENV=cosmos-predict1
|
|
51 |
# This ensures that executables (like python, pip, uvicorn) from this environment are found.
|
52 |
ENV PATH=$CONDA_DIR/envs/cosmos-predict1/bin:$PATH
|
53 |
|
54 |
-
#
|
55 |
-
# This is crucial for ensuring the correct CUDA-enabled builds are installed.
|
56 |
-
# We'll use CUDA 12.1 as it's commonly compatible with 12.4+ drivers.
|
57 |
RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
58 |
conda activate cosmos-predict1 && \
|
59 |
pip install --no-cache-dir \
|
@@ -61,7 +61,6 @@ RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
|
61 |
torchvision==0.18.1 \
|
62 |
torchaudio==2.3.1 \
|
63 |
--index-url https://download.pytorch.org/whl/cu121
|
64 |
-
# --- END NEW ---
|
65 |
|
66 |
# --- Verification Steps ---
|
67 |
RUN echo "Verifying Python and Conda installations..."
|
|
|
15 |
# Install essential system dependencies required for Miniconda and general build processes.
|
16 |
# This includes wget for downloading, git for cloning (if needed), build-essential for compiling,
|
17 |
# and libgl1-mesa-glx for graphics-related libraries often used by ML frameworks.
|
18 |
+
# NEW: Added libglib2.0-0 for cv2 dependency
|
19 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
20 |
wget \
|
21 |
git \
|
22 |
build-essential \
|
23 |
libgl1-mesa-glx \
|
24 |
+
libglib2.0-0 \
|
25 |
# Clean up apt cache to reduce image size
|
26 |
&& rm -rf /var/lib/apt/lists/*
|
27 |
|
|
|
53 |
# This ensures that executables (like python, pip, uvicorn) from this environment are found.
|
54 |
ENV PATH=$CONDA_DIR/envs/cosmos-predict1/bin:$PATH
|
55 |
|
56 |
+
# Install PyTorch and TorchVision via pip with specific CUDA index.
|
|
|
|
|
57 |
RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
58 |
conda activate cosmos-predict1 && \
|
59 |
pip install --no-cache-dir \
|
|
|
61 |
torchvision==0.18.1 \
|
62 |
torchaudio==2.3.1 \
|
63 |
--index-url https://download.pytorch.org/whl/cu121
|
|
|
64 |
|
65 |
# --- Verification Steps ---
|
66 |
RUN echo "Verifying Python and Conda installations..."
|