dev-bjoern commited on
Commit
e0b3a2c
·
verified ·
1 Parent(s): 38be658

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -3,13 +3,13 @@ import subprocess
3
  import os
4
  import spaces
5
 
6
- # Funktion zum Überprüfen und Finden des Blender-Pfads
7
  def find_blender_python():
8
  possible_paths = [
9
  "/usr/share/blender/4.2/python/bin/python3.10",
10
- "/usr/lib/blender/4.2/python/bin/python3.10",
11
- "/usr/bin/blender-python3.10",
12
- "/usr/lib/blender/3.6/python/bin/python3.10" # Ältere Version als Fallback
 
13
  ]
14
 
15
  for path in possible_paths:
@@ -17,8 +17,7 @@ def find_blender_python():
17
  return path
18
 
19
  # Breiterer Fallback-Suchbefehl
20
- blender_find_cmd = ["find", "/", "-name", "python3.*", "-path", "*/blender/*", "-type", "f"]
21
- result = subprocess.run(blender_find_cmd, capture_output=True, text=True)
22
  paths = result.stdout.strip().split("\n")
23
  if paths and paths[0] and os.path.exists(paths[0]):
24
  return paths[0]
@@ -26,7 +25,7 @@ def find_blender_python():
26
  # Debugging: Blender selbst suchen
27
  blender_bin = subprocess.run(["find", "/", "-name", "blender", "-type", "f"], capture_output=True, text=True)
28
  print(f"Blender-Binär gefunden: {blender_bin.stdout}")
29
- return None
30
 
31
  # Funktion zum Installieren von Infinigen
32
  def install_infinigen():
 
3
  import os
4
  import spaces
5
 
 
6
  def find_blender_python():
7
  possible_paths = [
8
  "/usr/share/blender/4.2/python/bin/python3.10",
9
+ "/usr/share/blender/3.6/python/bin/python3.10",
10
+ "/usr/share/blender/3.5/python/bin/python3.10",
11
+ "/usr/share/blender/3.1/python/bin/python3.10",
12
+ "/usr/lib/blender/3.1/python/bin/python3.10"
13
  ]
14
 
15
  for path in possible_paths:
 
17
  return path
18
 
19
  # Breiterer Fallback-Suchbefehl
20
+ result = subprocess.run(["find", "/", "-name", "python3.*", "-path", "*/blender/*", "-type", "f"], capture_output=True, text=True)
 
21
  paths = result.stdout.strip().split("\n")
22
  if paths and paths[0] and os.path.exists(paths[0]):
23
  return paths[0]
 
25
  # Debugging: Blender selbst suchen
26
  blender_bin = subprocess.run(["find", "/", "-name", "blender", "-type", "f"], capture_output=True, text=True)
27
  print(f"Blender-Binär gefunden: {blender_bin.stdout}")
28
+ raise RuntimeError("Blender Python-Interpreter nicht gefunden!")
29
 
30
  # Funktion zum Installieren von Infinigen
31
  def install_infinigen():