福州 哈尔滨网站建设 网络服务,无锡信息网站建设,兰州优化网站排名,wordpress xueqiu参考的博客#xff1a; Linux服务器安装Anaconda 并配置远程jupyter lab anaconda配置远程访问jupyter#xff0c;并创建虚拟环境 理解和创建#xff1a;Anaconda、Jupyterlab、虚拟环境、Kernel
下边是正文了。 https://www.anaconda.com/download是官网网址#xff0c;可…参考的博客 Linux服务器安装Anaconda 并配置远程jupyter lab anaconda配置远程访问jupyter并创建虚拟环境 理解和创建Anaconda、Jupyterlab、虚拟环境、Kernel
下边是正文了。 https://www.anaconda.com/download是官网网址可以下载最新版本。 https://repo.anaconda.com/archive/可以下载以前的版本注意需要选择自己需要的版本。 wget https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh下载安装脚本。
chmod ux Anaconda3-2023.03-1-Linux-x86_64.sh给shell脚本加上执行权限。 bash Anaconda3-2023.03-1-Linux-x86_64.sh开始安装按一下Enter键。 然后需要一直按Enter键直到出现Do you accept the license terms? [yes|no]这个提示词然后输入yes按下Enter键之后输入需要安装的目录我这里选择的是“/home/anaconda3”。 输入yes表明需要安装时进行初始化。 source ~/.bashrc激活基本环境。 重新打开远程登录直接进入到基本环境里。
conda create -n jupyterlabuse python3.10.9创建一个虚拟环境。
输入y。
完成之后如下图 conda activate jupyterlabuse激活jupyterlabuse的环境。
jupyter lab --generate-config执行之后发现报
-bash: jupyter: command not foundpip install jupyterlab -i https://pypi.mirrors.ustc.edu.cn/simple安装jupyterlab。 安装成功如下
jupyter lab --generate-config生成配置文件。 使用ipython然后输入from jupyter_server.auth import passwd;passwd(),之后输入两次一样的密码。 把单引号里边的argon2:$argon2id$v19$m10240,t10,p8$TnfU106ZqRr7ubwSg$/Phki8t73l68PBfSnY4ygtbwuP8NNhUsV5MFvfxUmI保存好因为接下来需要把它输入到/root/.jupyter/jupyter_lab_config.py里边。
然后输入exit()按下回车退出ipython。
使用sudo cat EOF/root/.jupyter/jupyter_lab_config.py把下边的内容保存到/root/.jupyter/jupyter_lab_config.py里边。
c.ServerApp.allow_remote_access True
c.ServerApp.ip 0.0.0.0
c.ServerApp.open_browser False
c.ServerApp.password argon2:$argon2id$v19$m10240,t10,p8$TnfU106ZqRr7ubwSg$/Phki8t73l68PBfSnY4ygtbwuP8NNhUsV5MFvfxUmI # 上面保存的密码
c.ServerApp.port 12345 # 服务器的端口号下边需要使用这个端口号每输入一行就按一下回车键。
tail -5 /root/.jupyter/jupyter_lab_config.py查看一下上边输入的内容。
nohup jupyter lab --allow-root 后台启动jupyter lab然后按一下回车键Enter。
python -m ipykernel install --user --name jupyterlabuse --display-name usertest直接在环境里执行下面的代码来手动添加kernel进jupyter lab。 conda deactivate先退出虚拟环境。 ps -aux | grep jupyter-lab找出来对应的进程然后使用kill -9 进程号杀死进程。
conda activate jupyterlabuse重新激活jupyterlabuse虚拟环境nohup jupyter lab --allow-root 后台启动jupyter lab。 把ip:port/lab端口号输入到浏览器中比如我这里在浏览器中输入192.168.53.240:12345/lab 然后按下回车就会自动跳转到192.168.53.240:12345/login?next%2Flab
输入密码就可以进入了选择自己刚刚创建的名为usertest的Kernel。
点击“Select”。
右上角变成了“usertest”
此文章为9月Day 17学习笔记内容来源于极客时间《零基础实战机器学习》。