利用本地浏览器远程服务器上的jupyter notebook(报错/usr/bin/python3: No module named ipykernel_launcher)
基本如帖子https://www.cnblogs.com/qiangzi0221/p/8933722.html
在本地浏览器中远程访问服务器中的conda虚拟环境部分中,创建一个叫env的虚拟环境,在虚拟环境中输入完
python -m ipykernel install --user --name env --display-name "env"
之后会报出Installed kernelspec learn in /home/amax/.local/share/jupyter/kernels/env
访问目录,编辑kernel.json文件(可能需要先运行一次jupyter notebook,这个文件才出现,期间报错/usr/bin/python3: No module named ipykernel_launcher,这里jupyter notebook从系统自带的/usr/bin/python3寻找ipykernel_launcher,因为jupyter装在conda虚拟环境中了,因此找不到ipykernel_launcher,报错)
{ "argv": [ "/usr/bin/python3", #这里替换为虚拟环境的python,/home/amax/anaconda3/envs/env/bin/python "-m", "ipykernel_launcher", "-f", "{connection_file}" ], "display_name": "Python 3", "language": "python" }
修改后运行jupyter notebook,可以成功启动ipykernel。