raksa-the-wildcats commited on
Commit
da68362
·
1 Parent(s): 8cc8be4

9th commit

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -73,16 +73,22 @@ class ManimAnimationGenerator:
73
  def install_manim(self):
74
  """Try to install Manim if not available"""
75
  try:
76
- # First install system dependencies
77
- sys_success, sys_msg = self.install_system_dependencies()
78
- if not sys_success:
79
- return False, sys_msg
80
-
81
- # Then install Manim
82
  subprocess.check_call([
83
  sys.executable, "-m", "pip", "install",
84
- "manim", "manimpango", "--quiet"
85
  ])
 
 
 
 
 
 
 
 
 
 
 
86
  return True, "Manim installed successfully"
87
  except subprocess.CalledProcessError as e:
88
  return False, f"Failed to install Manim: {str(e)}"
@@ -332,7 +338,6 @@ with gr.Blocks(title="Manim Animation Generator", theme=gr.themes.Soft()) as app
332
  code_input = gr.Code(
333
  label="Manim Code",
334
  language="python",
335
- placeholder="Enter your Manim code here...",
336
  lines=20,
337
  value=example_codes["Simple Square"]
338
  )
 
73
  def install_manim(self):
74
  """Try to install Manim if not available"""
75
  try:
76
+ # Try to install Manim first
 
 
 
 
 
77
  subprocess.check_call([
78
  sys.executable, "-m", "pip", "install",
79
+ "manim", "--quiet"
80
  ])
81
+
82
+ # Try to install manimpango separately if needed
83
+ try:
84
+ subprocess.check_call([
85
+ sys.executable, "-m", "pip", "install",
86
+ "manimpango", "--quiet"
87
+ ])
88
+ except subprocess.CalledProcessError:
89
+ # manimpango might fail, but manim might still work
90
+ pass
91
+
92
  return True, "Manim installed successfully"
93
  except subprocess.CalledProcessError as e:
94
  return False, f"Failed to install Manim: {str(e)}"
 
338
  code_input = gr.Code(
339
  label="Manim Code",
340
  language="python",
 
341
  lines=20,
342
  value=example_codes["Simple Square"]
343
  )