replace pip in notebook (#12808) (#12827)

This commit is contained in:
Barbara Valdez
2020-10-08 15:23:30 -07:00
committed by GitHub
parent 8a078d2d68
commit 6adeffbc8e

View File

@@ -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))"