利器3: Jupyterlab and its Kernels
New machine needs to be tailored for a better personal workflow. And this is about how jupyter can be a multi-language support co-work platform for regular DataScience works. Also note that Julia community has pluto notebook, and R has its RStudio.
##
JuPyteR: Julia + Python + R all in one
1 check the Python came with system
$ which python3
If there is no python3 yet, install one:
$ sudo apt install python3
Note that this would install the latest version of Python.
2 Poetry or Virtualenv (Poetry is way tooooo slow 2021-12)
# create virtual envs:
python3 -m venv dsvenv
# install jupyterlab:
./dsvenv/bin/python -m pip install jupyterlab
Note that this may create a venv without activate
scripts.
If this is the case, check more discussion
here
3 install R, then
5 activate python’s dsvenv (source ./dsvenv/bin/activate), then
a. Enter interactive R (REPL environment)
# install 'IRkernel'
install.packages('IRkernel')
# register the kernel in the current R installation
IRkernel::installspec()
# exit
q()
b. Enter interactive Julia (./path-to/julia.1.6.5/bin/julia)
using Pkg
Pkg.add("IJulia")
# Optional: build IJulia
Pkg.build("IJulia")
Note that if the path of binary of Julia somehow changed (reinstall etc),
one need to perform extra command Pkg.build("IJulia")
which tells jupyter
where to find the binary of Julia.
6 launch jupyterlab server, and that’s it!