google-compute-engine - 错误 : Unauthorized on my own Google Cloud notebook

标签 google-compute-engine jupyter-notebook ubuntu-16.04 ipython-notebook

我刚刚使用 Ubuntu 16.04 VM 构建了一个 Compute Engine 应用程序,在 Chrome 中启动它,安装了 python3、ipython 内核和一些库,这样我就可以运行 Jupyter notebooks。以下是命令:

sudo apt-get update
sudo apt-get install python3-setuptools python3-dev libzmq-dev
sudo easy_install3 pip
sudo pip3 install ipython pyzmq jinja2 tornado jsonschema
sudo pip3 install jupyter
sudo ipython kernel install
sudo pip3 install numpy scipy scikit-learn pandas matplotlib

最后一条命令给出了这条消息,两次:

The directory '/home/allennugent/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

希望这不会成为阻碍,我继续设置防火墙规则,源 IP 范围 = '0.0.0.0/0' 和协议(protocol)和端口 = 'tcp:8888'。然后我启动了 jupyter:

jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser &

这创建了指向笔记本的超链接。当我单击链接(在串行控制台窗口中)时,浏览器页面打开,其中包含

Error: Unauthorized You are currently logged in as [my gmail address] which does not have access to Cloud Shell 3118611.

根据 Cloud Platform 仪表板,我在设置 Compute Engine 时使用相同的帐户名登录,所以我不知道授权出了什么问题。

我错过了什么吗?

最佳答案

我也遇到了这个问题,对我来说,通过在地址栏中输入虚拟机的外部 IP 和端口(前面没有 http 或 https://)解决了这个问题。

例如xx.xxx.xxx.xxx:8888

然后对于我的笔记本,当 jupyter 在浏览器中显示时,我需要将访问 token ( token =[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] 部分,这里只是方括号中的字符)从终端复制到密码提示中。

关于google-compute-engine - 错误 : Unauthorized on my own Google Cloud notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46481563/

相关文章:

google-cloud-storage - 在 google 计算中创建磁盘时出错(未找到资源 '... diskTypes/{pd-ssd}'

python - 从 url 下载 csv 并使其成为数据框 python pandas

Python Jupyter Notebook 无法打开文件,可能输出太大

Docker:设备 cgroup 未安装(Ubuntu 16.04)

google-compute-engine - 如何关闭 Compute Engine 服务

google-cloud-platform - 谷歌计算引擎: Required 'compute.zones.get' permission error

Google Compute f1-micro 实例上的 Docker

python - 如何在不使用选项卡的情况下在 jupyter notebook 中获得自动完成功能?

linux - 如何限制在循环中执行的命令的 shell 脚本中的输出

python - 文件未找到错误 : [Errno 2] No such file or directory. Ubuntu