Upload 2 files
Browse files- app.py +32 -2
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -307,6 +307,16 @@ Hinweis: Du musst eingeloggt sein und die Terms akzeptieren!"""
|
|
| 307 |
progress(0.45, desc="🔧 Lade Netlistify-Module...")
|
| 308 |
|
| 309 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
# Installiere fehlende Netlistify-Abhängigkeiten dynamisch
|
| 311 |
def install_missing_package(package_name):
|
| 312 |
"""Installiert ein fehlendes Paket."""
|
|
@@ -314,7 +324,7 @@ Hinweis: Du musst eingeloggt sein und die Terms akzeptieren!"""
|
|
| 314 |
import subprocess
|
| 315 |
import sys
|
| 316 |
result = subprocess.run(
|
| 317 |
-
[sys.executable, "-m", "pip", "install", package_name, "--quiet"],
|
| 318 |
capture_output=True,
|
| 319 |
text=True,
|
| 320 |
timeout=120
|
|
@@ -323,6 +333,25 @@ Hinweis: Du musst eingeloggt sein und die Terms akzeptieren!"""
|
|
| 323 |
except:
|
| 324 |
return False
|
| 325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
# Liste der kritischen Netlistify-Abhängigkeiten
|
| 327 |
# Format: (pip_package_name, import_name)
|
| 328 |
# Hinweis: Diese werden automatisch installiert, falls sie fehlen
|
|
@@ -349,7 +378,8 @@ Hinweis: Du musst eingeloggt sein und die Terms akzeptieren!"""
|
|
| 349 |
("seaborn", "seaborn"),
|
| 350 |
("pypalettes", "pypalettes"),
|
| 351 |
("tensorboard", "tensorboard"),
|
| 352 |
-
("tensorboardx", "tensorboardX")
|
|
|
|
| 353 |
]
|
| 354 |
|
| 355 |
# Zusätzliche Pakete, die möglicherweise benötigt werden
|
|
|
|
| 307 |
progress(0.45, desc="🔧 Lade Netlistify-Module...")
|
| 308 |
|
| 309 |
try:
|
| 310 |
+
# Fix für protobuf _c_module Problem
|
| 311 |
+
# Dieses Problem tritt auf, wenn protobuf-Versionen inkompatibel sind
|
| 312 |
+
try:
|
| 313 |
+
import google.protobuf.internal.api_implementation as api_impl
|
| 314 |
+
if not hasattr(api_impl, '_c_module'):
|
| 315 |
+
# Setze _c_module auf None, falls es fehlt
|
| 316 |
+
api_impl._c_module = None
|
| 317 |
+
except:
|
| 318 |
+
pass
|
| 319 |
+
|
| 320 |
# Installiere fehlende Netlistify-Abhängigkeiten dynamisch
|
| 321 |
def install_missing_package(package_name):
|
| 322 |
"""Installiert ein fehlendes Paket."""
|
|
|
|
| 324 |
import subprocess
|
| 325 |
import sys
|
| 326 |
result = subprocess.run(
|
| 327 |
+
[sys.executable, "-m", "pip", "install", package_name, "--quiet", "--upgrade"],
|
| 328 |
capture_output=True,
|
| 329 |
text=True,
|
| 330 |
timeout=120
|
|
|
|
| 333 |
except:
|
| 334 |
return False
|
| 335 |
|
| 336 |
+
# Installiere/Upgrade protobuf zuerst (wichtig für tensorboard Kompatibilität)
|
| 337 |
+
try:
|
| 338 |
+
import google.protobuf
|
| 339 |
+
except ImportError:
|
| 340 |
+
progress(0.455, desc="📦 Installiere protobuf...")
|
| 341 |
+
install_missing_package("protobuf>=3.20.0,<5.0.0")
|
| 342 |
+
else:
|
| 343 |
+
# Prüfe Version und upgrade falls nötig
|
| 344 |
+
try:
|
| 345 |
+
import google.protobuf
|
| 346 |
+
protobuf_version = google.protobuf.__version__
|
| 347 |
+
# Prüfe ob Version kompatibel ist (3.20.0 - 4.x)
|
| 348 |
+
major, minor = map(int, protobuf_version.split('.')[:2])
|
| 349 |
+
if major < 3 or (major == 3 and minor < 20) or major >= 5:
|
| 350 |
+
progress(0.455, desc="📦 Upgrade protobuf für Kompatibilität...")
|
| 351 |
+
install_missing_package("protobuf>=3.20.0,<5.0.0")
|
| 352 |
+
except:
|
| 353 |
+
pass
|
| 354 |
+
|
| 355 |
# Liste der kritischen Netlistify-Abhängigkeiten
|
| 356 |
# Format: (pip_package_name, import_name)
|
| 357 |
# Hinweis: Diese werden automatisch installiert, falls sie fehlen
|
|
|
|
| 378 |
("seaborn", "seaborn"),
|
| 379 |
("pypalettes", "pypalettes"),
|
| 380 |
("tensorboard", "tensorboard"),
|
| 381 |
+
("tensorboardx", "tensorboardX"),
|
| 382 |
+
("protobuf", "google.protobuf")
|
| 383 |
]
|
| 384 |
|
| 385 |
# Zusätzliche Pakete, die möglicherweise benötigt werden
|
requirements.txt
CHANGED
|
@@ -36,6 +36,8 @@ seaborn>=0.13.0
|
|
| 36 |
pypalettes>=0.1.0
|
| 37 |
tensorboard>=2.14.0
|
| 38 |
tensorboardx>=2.6.0
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Zusätzliche Netlistify-Abhängigkeiten (werden bei Bedarf automatisch installiert)
|
| 41 |
bytecode>=0.15.0
|
|
|
|
| 36 |
pypalettes>=0.1.0
|
| 37 |
tensorboard>=2.14.0
|
| 38 |
tensorboardx>=2.6.0
|
| 39 |
+
protobuf>=3.20.0,<5.0.0
|
| 40 |
+
# Protobuf Fix für tensorboard Kompatibilität
|
| 41 |
|
| 42 |
# Zusätzliche Netlistify-Abhängigkeiten (werden bei Bedarf automatisch installiert)
|
| 43 |
bytecode>=0.15.0
|