简体   繁体   English

Jupyter 笔记本和 vscode

[英]Jupyter notebook and vscode

I create new ec2 for jupyter server and i'm running jupyter lab with back-ground so i can access jupyter lab in browser.我为 jupyter 服务器创建了新的 ec2,并且我正在后台运行 jupyter lab,因此我可以在浏览器中访问 jupyter lab。 However, i want to edit my ipynb file in vscode but in vscode i can connect jupyter server but i can't see directories or read files in ec2.但是,我想在 vscode 中编辑我的 ipynb 文件,但在 vscode 中我可以连接 jupyter 服务器,但在 ec2 中看不到目录或读取文件。 I tried over and over to connect the server and see the directories.我一遍又一遍地尝试连接服务器并查看目录。 The only solution I got was remote ssh.我得到的唯一解决方案是远程 ssh。 however, Remote-shh is not a good way for jobs in ec2 enter image description here Is anybody can give me an answer?但是,Remote-shh 不是 ec2 中工作的好方法 在此处输入图像描述有人可以给我答案吗?

I can only see the connection with vscode and i cannot see any files plz help me我只能看到与 vscode 的连接,我看不到任何文件请帮助我

remote ssh is the standard approach.远程 ssh 是标准方法。 you would need to SSH to your EC2 from vscode, then you can browse and run notebooks.你需要 SSH 从 vscode 到你的 EC2,然后你可以浏览和运行笔记本。

  • In vscode, go to extensions and install "Remote - SSH" & "Remote - SSH: Editing Configuration Files"在 vscode 中,go 到扩展并安装“远程 - SSH”和“远程 - SSH:编辑配置文件”
  • Open command palette (cmd/ctrl + shift + P) and type "show remote explorer"打开命令面板(cmd/ctrl + shift + P)并输入“显示远程资源管理器”
  • Add new ssh target by editing ~/.ssh/config .通过编辑~/.ssh/config添加新的 ssh 目标。 should look like:应该看起来像:
Host SOME-NAME
HostName YOUR-EC2-PUBLIC-IP
User YOUR-EC2-USER
IdentityFile PATH-TO-EC2-PEM-FILE

you can connect to your EC2 through vscode.您可以通过 vscode 连接到您的 EC2。 you can then open.ipynb files (assuming you have required extensions. eg: jupyter, IPython kernel) as well as having files explorer.然后,您可以打开.ipynb 文件(假设您有所需的扩展名。例如:jupyter、IPython 内核)以及文件资源管理器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM