thomasanto7001 commited on
Commit
4379280
·
verified ·
1 Parent(s): 2c1e48f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -25
app.py CHANGED
@@ -1,42 +1,27 @@
1
  import os
2
- import subprocess
3
- import sys
4
-
5
- # Print Python environment info (optional, for logs)
6
- print("Python executable:", sys.executable)
7
- print("Python version:", sys.version)
8
-
9
- try:
10
- import moviepy
11
- moviepy_path = os.path.dirname(moviepy.__file__)
12
- print("moviepy path:", moviepy_path)
13
-
14
- editor_path = os.path.join(moviepy_path, "editor.py")
15
- editor_folder_path = os.path.join(moviepy_path, "editor")
16
 
17
- print("moviepy/editor.py exists:", os.path.isfile(editor_path))
18
- print("moviepy/editor/ folder exists:", os.path.isdir(editor_folder_path))
 
19
 
20
- except Exception as e:
21
- print("Failed to import moviepy:", e)
22
-
23
- # Force reinstall moviepy to fix possible incomplete install
24
  try:
25
- subprocess.check_call([sys.executable, "-m", "pip", "install", "--force-reinstall", "moviepy==2.2.1"])
26
- print("moviepy reinstalled successfully.")
27
  except Exception as e:
28
- print("Failed to reinstall moviepy:", e)
29
 
 
30
 
31
 
32
  import whisper
33
- from moviepy.editor import VideoFileClip
34
  from transformers import pipeline
35
  import nltk
36
  #import os
37
  import re
38
  import random
39
- #import subprocess
40
  from sklearn.feature_extraction.text import TfidfVectorizer
41
  from sklearn.metrics.pairwise import cosine_similarity
42
  from nltk.tokenize import sent_tokenize
 
1
  import os
2
+ import moviepy
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ moviepy_path = os.path.dirname(moviepy.__file__)
5
+ print("moviepy path:", moviepy_path)
6
+ print("Contents of moviepy package directory:", os.listdir(moviepy_path))
7
 
 
 
 
 
8
  try:
9
+ import moviepy.editor
10
+ print("moviepy.editor imported successfully")
11
  except Exception as e:
12
+ print("Failed to import moviepy.editor:", e)
13
 
14
+ from moviepy.editor import VideoFileClip
15
 
16
 
17
  import whisper
18
+ #from moviepy.editor import VideoFileClip
19
  from transformers import pipeline
20
  import nltk
21
  #import os
22
  import re
23
  import random
24
+ import subprocess
25
  from sklearn.feature_extraction.text import TfidfVectorizer
26
  from sklearn.metrics.pairwise import cosine_similarity
27
  from nltk.tokenize import sent_tokenize