from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
After Change
import os
import matplotlib
// If there is no display or a matplotlib backend already defined, use the non-GUI backend
if "DISPLAY" not in os.environ or "MPLBACKEND" not in os.environ:
matplotlib.use("Agg")