配置工作用的conda环境/远程访问的jupyterlab

conda create -n envs_name python = 3.8
conda activate envs_name
安装所需的R包和python包
pip install jupyterlab==2.2.9
(这里选择了安装2.2.9的jupyterlab, 因为发现3.0.0版本做了改动,可能导致无法远程连接
改动: https://jupyter-server.readthedocs.io/en/latest/operators/migrate-from-nbserver.html)
随便产生并修改jupyter_notebook_config.py中的设置以供远程访问
(1)添加R kernel :
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec() #确保jupyterLab能找到R解释器安装位置
(2)添加python虚拟环境 kernel
conda activate envs_name
conda install ipykernel
ipython kernel install --user --name=apec_env

最后一步:
输入jupyer lab
在本机上构建与服务器的ssh连接:
ssh -N -f -L localhost:8888:XXX:9999 [email protected] -p XX
在浏览器输入localhost:8888即可进行远程访问

你可能感兴趣的:(配置工作用的conda环境/远程访问的jupyterlab)