Linux 服务器设置 Jupyter-Notebook 远程连接

Linux服务器Jupyter-Notebook 远程连接设置

重点参考自 Jupyter notebook连接远程服务器和配置Anaconda环境简单教程

1、首先要在Linux服务器上安装Jupyter notebook。
安装Jupyter notebook:

pip install Jupyter

2、生成Jupyter notebook 配置文件

jupyter notebook --generate-config

3、配置Jupyter notebook密码

jupyter notebook password
Enter password: ****(自定义)
Verify password: ****

新版的Jupyter notebook只需要输入密码确认,然后它会自动帮你把生成含有密码的hash码输入进jupyter_notebook_config.json 文件。

4、配置 jupyter_notebook_config.py 文件

进入vim编辑器对jupyter_notebook_config.py 进行编辑。

vim ~/.jupyter/jupyter_notebook_config.py

取消以下配置的注释,并修改内容如下:

c.NotebookApp.allow_remote_access = True
c.NotebookApp.open_browser = False
c.NotebookApp.ip = ‘*’
c.NotebookApp.allow_root = True
c.NotebookApp.port = 8888 # 其实这个我不知道有用木,因为我后来是指定端口启动的

注意!!!
取消注释时修改代码一定要左侧顶格,不然会报错!!!

5、在Linux控制台输入命令启动服务

jupyter notebook --no-browser --port=80 --ip=0.0.0.0

其中,
–no-browser:表示Linux服务器不自动弹出浏览器。
–port=80 --ip=0.0.0.0:80表示jupyter服务将启动在80端口,0.0.0.0表示允许任何主机访问。

6、本地使用Linux服务器的jupyter

在本地浏览器输入

http://(服务器ip地址):80(端口号)

输入密码登录,即可远程使用。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
要在PyCharm中远程连接Linux上的Jupyter Notebook,你需要按照以下步骤进行设置: 1. 在Linux服务器上安装Jupyter Notebook并生成密码密钥。你可以使用以下命令安装Jupyter Notebook并生成密钥: ``` pip install jupyter jupyter notebook --generate-config jupyter notebook password ``` 2. 修改Jupyter Notebook的配置文件。使用文本编辑器打开配置文件`~/.jupyter/jupyter_notebook_config.py`,并进行以下修改: ``` c.NotebookApp.allow_remote_access = True c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.password = 'your_password' c.NotebookApp.port = 8888 ``` 3. 启动Jupyter Notebook。在Linux服务器上运行以下命令启动Jupyter Notebook: ``` jupyter notebook ``` 4. 在PyCharm中配置远程连接。打开PyCharm,点击"File" -> "Settings" -> "Project Interpreter",然后点击右上角的齿轮图标,选择"Add" -> "SSH Interpreter"。填写Linux服务器的连接信息,并选择正确的Python解释器路径。 5. 连接到远程Jupyter Notebook。在PyCharm中,点击"View" -> "Tool Windows" -> "Python Console",然后输入以下命令连接到远程Jupyter Notebook: ``` import jupyter_client jupyter_client.kernelspec.find_kernel_specs() ``` 这样,你就可以在PyCharm中远程连接Linux上的Jupyter Notebook了。请确保你已经正确配置了SSH连接和Python解释器路径。 #### 引用[.reference_title] - *1* [本地pycharm连接远程linux服务器使用jupyter](https://blog.csdn.net/hpccph15/article/details/125170565)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [解决pycharm 连接服务器使用Jupyter Notebook无法运行问题](https://blog.csdn.net/Fuziqp/article/details/121511821)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [关于如何在本地的pycharm上面使用远程服务器jupyter notebook问题](https://blog.csdn.net/m0_50434358/article/details/123883643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Gaolw1102

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值