From f803f9701e1a9a3d1d2071ee2e8b951797163b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Thu, 21 Mar 2019 16:07:11 +0100 Subject: [PATCH] --- tutorial.ipynb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tutorial.ipynb b/tutorial.ipynb index 01f7fba..51b8b8f 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -6,12 +6,13 @@ "metadata": {}, "outputs": [], "source": [ - "try:\n", - " import bitter\n", - "except ImportError:\n", - " import pip\n", - " pip.main(['install', '--user', 'bitter'])\n", - " import bitter\n", + "# Install a pip package in the current Jupyter kernel.\n", + "import sys\n", + "import site\n", + "usersite = site.getusersitepackages()\n", + "if usersite not in sys.path:\n", + " sys.path.append(usersite)\n", + "!{sys.executable} -m pip install --user -r requirements.txt", "import os" ] }, @@ -158,4 +159,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file