gpt4 book ai didi

python - Gtk-警告 ** : cannot open display: :0. 0 --- Ubuntu 14.04

转载 作者:行者123 更新时间:2023-12-04 19:14:00 24 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。


4年前关闭。







Improve this question




我刚刚在亚马逊 EC2 实例(ubuntu 14.04)上安装了 OpenCV 3.2.0。当我尝试运行任何示例程序时,我收到错误 Gtk-WARNING **: cannot open display: :0.0网上类似问题的答案对我不起作用。我试过了export DISPLAY=:0.0export DISPLAY=:0我试过xhost +localhost并收到xhost: unable to open display ":0.0"
这篇文章描述了与我完全相同的问题,但我没有使用 Vagrant,所以没有“Vagrantfile”,我不知道 EC2 实例中的等价物是什么。
Gtk-WARNING **: cannot open display:

有谁知道为什么会这样?

最佳答案

我在 Ubuntu 16.04 上使用 ssh 连接到 Ubuntu 16.04.2 服务器。我可以执行以下操作:

xhost +
ssh -Y -i .ssh/my.pem ubuntu@ecxxxxxxx.eu-west-1.compute.amazonaws.com
sudo apt install x11-apps
xclock

这会在我的本地显示器上启动 xclock 小程序。注意我 ssh 之前的 xhost + 和 ssh 命令上的 -Y 标志。我正在使用 xclock 来测试我从 x11-apps 安装的。您应该能够以类似的方式启动 OpenCV。

关于python - Gtk-警告 ** : cannot open display: :0. 0 --- Ubuntu 14.04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45247821/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com