Skip to content

Commit

Permalink
adding logic for when matplotlib isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Sep 3, 2024
1 parent 59400ab commit a525c5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sageworks/repl/sageworks_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

try:
import matplotlib.pyplot as plt # noqa
HAVE_MATPLOTLIB = True
except ImportError:
pass
HAVE_MATPLOTLIB = False


# SageWorks Imports
Expand Down Expand Up @@ -89,7 +90,8 @@ def __init__(self):
self.shell = InteractiveShellEmbed(config=config, banner1="", exit_msg="Goodbye from SageWorks!")

# Set matplotlib to interactive mode
self.shell.run_line_magic("matplotlib", "auto")
if HAVE_MATPLOTLIB:
self.shell.run_line_magic("matplotlib", "auto")

# Register our custom commands
self.commands["help"] = self.help
Expand Down

0 comments on commit a525c5d

Please sign in to comment.