display: unable to open X server

不羁的心 提交于 2020-01-25 02:58:08

问题


I am running ImageMagick on my Mac which runs on Yosemite. I have just downloaded ImageMagick and I am trying to open the logo display by running this on the command line:

display logo.gif

after executing the above command, I am getting the following error:

display: unable to open X server `:0.0' @ error/display.c/DisplayImageCommand/426.

I've implemented all the steps to install ImageMagick, including executing the following command:

export DISPLAY=:0.0

and I am still not getting the display to show up. When I echo $DISPLAY, my console shows 0.0.

How can I fix this error? Any help is appreciated.


回答1:


Do not attempt to export the $DISPLAY environment variable, as this will be set when X11 (XQuartz) is launched. On OS X, this is usually a unique unix path. Something like:

 echo $DISPLAY
 #=> /private/tmp/com.apple.launchd.CWOgR6ULcX/org.macosforge.xquartz:0 

The best way to start X sever (IMHO) is to use Spotlight

  1. + space
  2. Search for "X11" followed by
  3. Open new terminal window & run your display command


来源:https://stackoverflow.com/questions/36251754/display-unable-to-open-x-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!