diff --git a/pyxtal/XRD.py b/pyxtal/XRD.py index 3f072044..7b88306c 100644 --- a/pyxtal/XRD.py +++ b/pyxtal/XRD.py @@ -536,7 +536,7 @@ def plotly_pxrd( title="PXRD of " + self.name, ) - if os.environ["_"].find("jupyter") == -1: + if os.environ.get("_", "").find("jupyter") == -1: if html is None: return fig.to_html() else: