搭建c++ python jupyter lab 在线环境

本机配置
centos 7 x86_64
conda 4.10.1
首先我们需要安装Mamba,既然是用来加速Conda,那么我们可以直接使用下列命令来安装Mamba:

conda install -c conda-forge mamba

安装完成之后,当你运行mamba -V查看其版本时会发现返回的是Conda的版本信息,这是因为Mamba的本质是对Conda功能的覆盖,因此我们在使用Mamba时其实只要将原有的Conda语句中的conda替换为mamba即可,譬如我们常用的conda clean --all,即清空本地缓存安装包:
当然Mamba并不是重写了Conda所有的功能,只是针对一些Conda低效的功能进行重写,并添加了一些实用的新功能,接下来我们来对这些知识进行学习。

mamba create -n cling
source activate cling
mamba install xeus-cling -c conda-forge

pip install jupyterlab 


下面是配置jupyterlab

jupyter lab --generate-config
vim /root/.jupyter/jupyter_lab_config.py

生成密码

[root@iZuf62qojdpdfmeohedn2jZ /]# ipython
Python 3.6.4 (default, Apr 10 2020, 10:25:04) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from notebook.auth import passwd

In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: '这里输出的是密钥,配置文件中要用到'

c.ServerApp.notebook_dir = '/root/notebook/'
c.ServerApp.open_browser = False
c.ServerApp.password = '生成的密码'
c.ServerApp.port = 8888
c.ServerApp.ip = '192.168.0.167'
c.ServerApp.allow_root = True
c.ServerApp.allow_remote_access = True
c.ServerApp.local_hostnames = ['localhost']

运行命令

 nohup jupyter lab  --config=/root/.jupyter/jupyter_lab_config.py &

posted @ 2021-04-30 19:03  simp00  阅读(262)  评论(0编辑  收藏  举报