docker run -d --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work -e GRANT_SUDO=yes --user root jupyter/datascience-notebook:$tag start-notebook.sh --NotebookApp.token=password
127.0.0.1:8888/lab
from your browser.password
when prompted for a password on the login screen.run_jupyter_lab
#!/bin/bash
tag=latest
password=password
port=8888
# validate args
if [ $# -gt 1 ]; then
echo ERROR: the number of args must be 0 or 1
exit 1
fi
# if a port num is specified, then change the port num
if [ $# -ne 0 ]; then
port=$1
fi
# the name of running container with port num
name=jl_${port}
# run juypyter lab with port $port
docker run -d --rm -p ${port}:8888 --name ${name} -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work -e GRANT_SUDO=yes --user root jupyter/datascience-notebook:$tag start-notebook.sh --NotebookApp.token=$password
Put this in something like ~ / bin / run_jupyter_lab
. It is assumed that PATH is in here.
When you execute the run_jupyter_lab
command, docker container will run with the name of the directory you executed. Run it in the directory where your notebook is.
settings.json
{
"python.pythonPath": "./.venv/bin/python3",
"python.analysis.extraPaths": [
"hoge/"
],
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": false,
"python.linting.pycodestyleEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--ignore=W293, W504",
"--max-line-length=200",
"--max-complexity=20"
],
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--aggressive",
"--aggressive"
],
"autoDocstring.docstringFormat": "google",
"editor.formatOnSave": true
}
pipenv --python 3.8
pipenv install --dev autopep8 flake8
If you use jupyter
pipenv install --dev ipykernel
Library installation that seems necessary
pipenv install pandas scikit-learn matplotlib
Recommended Posts