【已解决】谷歌colab在线编辑器无法连接Python本地

【背景】

首先,出于新旧两台电脑交替使用Python进行数据入库等的协同工作需求,在下面这篇帖子的推荐下,打开了谷歌Colaboratory Google提供的在线编辑器
(https://colab.research.google.com)
—— ——
Google推出了牛逼的Python在线编辑器,以后协同项目代码就省心了(https://blog.csdn.net/seoyundu/article/details/90131364)

【报错】

本地代码贴进来准备运行的时候,连接不上(如图)。
在这里插入图片描述

【结果】

按照提示,pip了四个东东,搞定,连接成功。

【解决过程】

这有个帖子,pip代码齐全。叠加colab报错提示,我pip了帖子里的step2和step3.
附上帖子地址:https://robotwealth.com/how-to-connect-google-colab-to-a-local-jupyter-runtime/
—— ——

贴出step2和step3

Step2: Install Jupyter server extension for using a WebSocket to proxy HTTP traffic
The colab team authored thejupyter_http_over_ws extension. Install it by doing:

pip install jupyter_http_over_ws

Then enable it by doing:

jupyter serverextension enable --py jupyter_http_over_ws

Step 3: Start a local Jupyter server
We need a local Jupyter server that trusts WebSocket connections from the Colab frontend. The following command and flags accomplish this:

jupyter notebook \
–NotebookApp.allow_origin=‘https://colab.research.google.com’ \
–port=8888 \
–NotebookApp.port_retries=0
Once the server has started, it will print a message with the initial backend URL used for authentication. You’ll need a copy of this in the next step:
在这里插入图片描述

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值