diff --git a/examples/hello_world.ipynb b/examples/hello_world.ipynb index c6fcc3d9..8d96d8a3 100644 --- a/examples/hello_world.ipynb +++ b/examples/hello_world.ipynb @@ -18,15 +18,16 @@ }, "outputs": [], "source": [ - "import sys, os\n", + "import sys\n", + "import os\n", "if 'google.colab' in sys.modules:\n", " !pip --quiet install open-atmos-jupyter-utils\n", " from open_atmos_jupyter_utils import pip_install_on_colab\n", " pip_install_on_colab('PyPartMC')\n", "elif '.arm.gov' in os.environ['JUPYTER_IMAGE']:\n", " !pip --quiet install PyPartMC\n", - " _pip_paths = !pip show PyPartMC | fgrep Location | cut -f2 -d' '\n", - " if _pip_paths[0] not in sys.path: sys.path.append(_pip_paths[0])" + " _pypartmc_path = !pip show PyPartMC | fgrep Location | cut -f2 -d' '\n", + " sys.path.extend(_pypartmc_path if _pypartmc_path[0] not in sys.path else [])" ] }, {