Skip to content

Commit

Permalink
switching backend to agg on matplotlib package install
Browse files Browse the repository at this point in the history
  • Loading branch information
Red Giuliano committed Jan 9, 2025
1 parent 9202e17 commit 29dc2a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zt_backend/utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ async def dependency_update(
await websocket.send_json({"output": line})
process.stdout.close()
write_dependencies(dependency_request.dependencies)
if any(dep.startswith("matplotlib") for dep in dependency_request.dependencies):
try:
import matplotlib
matplotlib.use("Agg")
except Exception as e:
logger.info('matplotlib not found')
return parse_dependencies()
except Exception as e:
logger.error("Error updating dependencies: %s", traceback.format_exc())

0 comments on commit 29dc2a7

Please sign in to comment.