Faham commited on
Commit
f388488
·
1 Parent(s): 04130dc

FIX: moviepy dependency issues

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -0
  2. app.py +9 -1
Dockerfile CHANGED
@@ -21,12 +21,17 @@ RUN apt-get update && apt-get install -y \
21
  libpng-dev \
22
  libtiff-dev \
23
  ffmpeg \
 
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
  # Copy requirements and install Python dependencies
27
  COPY requirements.txt .
 
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
 
 
 
30
  # Copy the app
31
  COPY app.py .
32
  COPY simple_model_manager.py .
 
21
  libpng-dev \
22
  libtiff-dev \
23
  ffmpeg \
24
+ libav-tools \
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
  # Copy requirements and install Python dependencies
28
  COPY requirements.txt .
29
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
30
  RUN pip install --no-cache-dir -r requirements.txt
31
 
32
+ # Verify moviepy installation
33
+ RUN python -c "import moviepy; print('MoviePy version:', moviepy.__version__)"
34
+
35
  # Copy the app
36
  COPY app.py .
37
  COPY simple_model_manager.py .
app.py CHANGED
@@ -614,7 +614,15 @@ def extract_audio_from_video(video_file):
614
  """
615
  try:
616
  import tempfile
617
- from moviepy import VideoFileClip
 
 
 
 
 
 
 
 
618
 
619
  # Save video bytes to temporary file
620
  with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmp_file:
 
614
  """
615
  try:
616
  import tempfile
617
+
618
+ try:
619
+ from moviepy import VideoFileClip
620
+ except ImportError as e:
621
+ st.error(f"MoviePy import failed: {e}")
622
+ st.error(
623
+ "This usually means the Docker build failed to install moviepy properly"
624
+ )
625
+ return None
626
 
627
  # Save video bytes to temporary file
628
  with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmp_file: