1
0
mirror of https://github.com/gsi-upm/sitc synced 2024-11-21 22:12:30 +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

@ -1,74 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting future (from -r requirements.txt (line 1))\n",
"Collecting rdflib (from -r requirements.txt (line 2))\n",
" Using cached https://files.pythonhosted.org/packages/3c/fe/630bacb652680f6d481b9febbb3e2c3869194a1a5fc3401a4a41195a2f8f/rdflib-4.2.2-py3-none-any.whl\n",
"Collecting rdflib-jsonld (from -r requirements.txt (line 3))\n",
"Collecting lxml (from -r requirements.txt (line 4))\n",
" Using cached https://files.pythonhosted.org/packages/a9/3c/2a9b8a58d9e7a8e3123ada3e3420fb3a963420a1ed235d62647a55edb359/lxml-4.3.1-cp36-cp36m-manylinux1_x86_64.whl\n",
"Collecting html5lib (from -r requirements.txt (line 5))\n",
" Downloading https://files.pythonhosted.org/packages/a5/62/bbd2be0e7943ec8504b517e62bab011b4946e1258842bc159e5dfde15b96/html5lib-1.0.1-py2.py3-none-any.whl (117kB)\n",
"\u001b[K 100% |████████████████████████████████| 122kB 1.3MB/s ta 0:00:01\n",
"\u001b[?25hCollecting pyparsing (from rdflib->-r requirements.txt (line 2))\n",
" Downloading https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)\n",
"\u001b[K 100% |████████████████████████████████| 71kB 2.0MB/s ta 0:00:01\n",
"\u001b[?25hCollecting isodate (from rdflib->-r requirements.txt (line 2))\n",
" Using cached https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl\n",
"Collecting webencodings (from html5lib->-r requirements.txt (line 5))\n",
" Downloading https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl\n",
"Collecting six>=1.9 (from html5lib->-r requirements.txt (line 5))\n",
" Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl\n",
"Installing collected packages: future, pyparsing, six, isodate, rdflib, rdflib-jsonld, lxml, webencodings, html5lib\n",
"Successfully installed future-0.17.1 html5lib-1.0.1 isodate-0.6.0 lxml-4.3.1 pyparsing-2.3.1 rdflib-4.2.2 rdflib-jsonld-0.4.0 six-1.12.0 webencodings-0.5.1\n",
"\u001b[33mYou are using pip version 9.0.1, however version 19.0.2 is available.\n",
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
]
}
],
"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": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@ -68,67 +68,18 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {},
"deletable": false,
"editable": false,
"nbgrader": {
"checksum": "3291946a5839da468d738588564690ec",
"grade": false,
"grade_id": "cell-oaisjd",
"locked": true,
"schema_version": 1,
"solution": false
}
},
"outputs": [], "outputs": [],
"source": [ "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 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" "!{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", "cell_type": "markdown",
"metadata": { "metadata": {