From 6adeffbc8e47dce18954e1ea107efde9f98c4e47 Mon Sep 17 00:00:00 2001 From: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com> Date: Thu, 8 Oct 2020 15:23:30 -0700 Subject: [PATCH] replace pip in notebook (#12808) (#12827) --- .../resources/notebooks/JupyterBooksCreate.ipynb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/notebook/resources/notebooks/JupyterBooksCreate.ipynb b/extensions/notebook/resources/notebooks/JupyterBooksCreate.ipynb index 75ea23a41c..f136d99317 100644 --- a/extensions/notebook/resources/notebooks/JupyterBooksCreate.ipynb +++ b/extensions/notebook/resources/notebooks/JupyterBooksCreate.ipynb @@ -51,7 +51,8 @@ " cmd = f'{sys.executable} -m pip show jupyter-book'\n", " cmdOutput = !{cmd}\n", " if len(cmdOutput) <= 1:\n", - " !pip install jupyter-book\n", + " cmd = f'{sys.executable} -m pip install jupyter-book'\n", + " !{cmd}\n", " cmd = f'{sys.executable} -m pip show jupyter-book'\n", " cmdOutput = !{cmd}\n", " for x in cmdOutput:\n", @@ -86,10 +87,12 @@ " if use_current in ['no', 'n']:\r\n", " install_version = input(f'Please enter the version you would like to use (eg. 0.7.4)')\r\n", " if install_version:\r\n", - " !pip uninstall jupyter-book --yes\r\n", + " cmd = f'{sys.executable} -m pip uninstall jupyter-book --yes'\r\n", + " !{cmd}\r\n", " version = ''\r\n", " print('Installing Jupyter-book...')\r\n", - " !pip install jupyter-book==\"$install_version\"\r\n", + " cmd = f'{sys.executable} -m pip install jupyter-book=={install_version}'\r\n", + " !{cmd}\r\n", " version, _ = getJupyterBookVersion()\r\n", "except Exception as e:\r\n", " raise SystemExit(str(e))"