我正在使用 GCP。启动镜像:c3-deeplearning-tf-1-14-cu100-20191004
Debian GNU/Linux 9.11(延伸)(GNU/Linux 4.9.0-11-amd64 x86_64\n)
错误信息: _tkinter.TclError:没有显示名称,也没有 $DISPLAY 环境变量
我想使用显示设备。
https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display?hl=en
我看到了这个文档。但是,只有窗口服务器解决方案。
我可以获得有关在 linux 服务器中运行 tkinter 的帮助吗?
最佳答案
如果我理解您想要实现的目标,那就是使用远程桌面。为此,您必须遵循以下步骤:
通过 SSH 连接到您的实例
安装 Debian Linux Chrome 远程桌面软件包
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
更新包管理器数据:
sudo apt update.
安装包及其依赖项
sudo dpkg --install chrome-remote-desktop_current_amd64.deb
sudo apt install --assume-yes --fix-broken
使用 Chrome 远程桌面连接到实例 web site
我建议您查看Official Documentation供进一步引用
关于python - 如何在 GCP -linux 中使用显示设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58396620/