1
0
mirror of https://github.com/gsi-upm/sitc synced 2025-12-15 09:38:16 +00:00

Fix pip install --user

This commit is contained in:
J. Fernando Sánchez
2019-02-14 18:10:50 +01:00
parent 139a6f5d69
commit ea0b4748b6
2 changed files with 6 additions and 129 deletions

View File

@@ -68,67 +68,18 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false,
"nbgrader": {
"checksum": "3291946a5839da468d738588564690ec",
"grade": false,
"grade_id": "cell-oaisjd",
"locked": true,
"schema_version": 1,
"solution": false
}
},
"metadata": {},
"outputs": [],
"source": [
"# Install a pip package in the current Jupyter kernel\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"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": false,
"editable": false,
"nbgrader": {
"checksum": "2407937d03fd7b85d5e3580d32707f29",
"grade": false,
"grade_id": "cell-oaisjdojasid",
"locked": true,
"schema_version": 1,
"solution": false
}
},
"source": [
"**ALTERNATIVELY**, if this doesn't work, try this:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"deletable": false,
"editable": false,
"nbgrader": {
"checksum": "e4ee23a6c5b09ac89d0c5e3bd36df7ec",
"grade": false,
"grade_id": "cell-install2",
"locked": true,
"schema_version": 1,
"solution": false
}
},
"outputs": [],
"source": [
"# Install a pip package in the current Jupyter kernel\n",
"import sys\n",
"import os\n",
"sys.path.append(os.path.join(os.getcwd(), '.jupyter'))\n",
"!{sys.executable} -m pip install --target '.jupyter' -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {