If arlpy is imported by a script run using %run in Jupyter, then the _sys.argv[0] doesn't seem to contain ipykernel_launcher anymore, but contains the name of the script being run.
Looking for ZMQInteractiveShell in get_ipython().__class__.__name__ seems to be a much more reliable way to figure out if we're inside a Jupyter session
If arlpy is imported by a script run using
%run
in Jupyter, then the_sys.argv[0]
doesn't seem to containipykernel_launcher
anymore, but contains the name of the script being run.Looking for
ZMQInteractiveShell
inget_ipython().__class__.__name__
seems to be a much more reliable way to figure out if we're inside aJupyter
session