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