Skip to content
Snippets Groups Projects

Fixed running cells on pyenv kernel tutorial

Open Filipe Guimaraes requested to merge guimaraes1/j4j_notebooks:master into master
1 file
+ 59
46
Compare changes
  • Side-by-side
  • Inline
``` bash
``` bash
export PYENV_ROOT=${PROJECT_<projectid>}/${USER}/.pyenv
# INPUT NEEDED
 
PROJECT_NAME=${PROJECT}
 
 
export PYENV_ROOT=${PROJECT_NAME}/${USER}/.pyenv
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PYENV_ROOT/bin:$PATH"
``` bash
``` bash
export PYENV_ENV=my_env
# INPUT NEEDED
 
ENV_NAME=my_env
 
 
export PYENV_ENV=${ENV_NAME}
 
%% Cell type:markdown id: tags:
 
The kernel name (must be lower case) may also be chosen and set into a variable:
 
%% Cell type:code id: tags:
 
``` bash
 
# INPUT NEEDED:
 
KERNEL_NAME="pyenv_${PYENV_ENV}"
 
 
export KERNEL_NAME=$(echo "${KERNEL_NAME}" | awk '{print tolower($0)}')
 
echo ${KERNEL_NAME} # double check
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
``` bash
``` bash
$ module purge
module purge
$ module list
module list # double check
Currently Loaded Modules:
1) Stages/2020 (S)
Where:
S: Module is Sticky, requires --force to unload or purge
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
``` bash
``` bash
(my_env)$ python --version
python --version # double check: Python 3.10.1 in our example
Python 3.10.1
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
``` bash
``` bash
(my_env)$ pip list
pip list # double check
Package Version
# Package Version
---------- -------
# ---------- -------
pip 21.2.4
# pip 21.2.4
setuptools 58.1.0
# setuptools 58.1.0
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
``` bash
``` bash
(my_env)$ pip list
pip list #double check that the required modules are installed
Package Version
# Package Version
----------------- -------
# ----------------- -------
backcall 0.2.0
# backcall 0.2.0
debugpy 1.5.1
# debugpy 1.5.1
decorator 5.1.1
# decorator 5.1.1
entrypoints 0.3
# entrypoints 0.3
ipykernel 6.6.1
# ipykernel 6.6.1
ipython 7.31.0
# ipython 7.31.0
jedi 0.18.1
# jedi 0.18.1
jupyter-client 7.1.0
# jupyter-client 7.1.0
jupyter-core 4.9.1
# jupyter-core 4.9.1
matplotlib-inline 0.1.3
# matplotlib-inline 0.1.3
nest-asyncio 1.5.4
# nest-asyncio 1.5.4
parso 0.8.3
# parso 0.8.3
pexpect 4.8.0
# pexpect 4.8.0
pickleshare 0.7.5
# pickleshare 0.7.5
pip 21.1.1
# pip 21.1.1
prompt-toolkit 3.0.24
# prompt-toolkit 3.0.24
ptyprocess 0.7.0
# ptyprocess 0.7.0
Pygments 2.11.2
# Pygments 2.11.2
python-dateutil 2.8.2
# python-dateutil 2.8.2
pyzmq 22.3.0
# pyzmq 22.3.0
setuptools 56.0.0
# setuptools 56.0.0
six 1.16.0
# six 1.16.0
tornado 6.1
# tornado 6.1
traitlets 5.1.1
# traitlets 5.1.1
wcwidth 0.2.5
# wcwidth 0.2.5
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
"-f",
"-f",
"{connection_file}"
"{connection_file}"
],
],
"display_name": "pyenv_'"${PYENV_ENV}"'",
"display_name": "'${KERNEL_NAME}'",
"language": "python"
"language": "python"
}' > $HOME/.local/share/jupyter/kernels/pyenv_${PYENV_ENV}/kernel.json
}' > $HOME/.local/share/jupyter/kernels/pyenv_${PYENV_ENV}/kernel.json
Loading