Pycharm Startup Error: Unable to detect graphics environment
I had the same error installing in a clean Ubuntu 17.10, with Gnome on Wayland. At @mattdm's suggestion in your comments, I just opened a new terminal (as myself, not root) and it ran fine. I was running as root (after unpacking everything to /opt/) when I got the error.
mike@feynman:~$ /opt/pycharm/bin/pycharm.sh
Once you register/activate, just click the "* Configure v" pulldown from the welcome window, and select "Create Desktop Entry" to make it available from your OS menus. I'm assuming JetBrains made this work for whichever linux flavor you prefer.
Your X environment is not properly set (manually setting DISPLAY
doesn't always work). Possibly because you're attempting this as root
and root
is not the owner of the graphics session. There could be other reasons, too.
You won't be able to run xclock
or any other X app either in this situation - this is the clue that it's not a pycharm
-related problem. For example if you ssh to localhost as root
, not as the user currently logged in into the graphical session:
laptop:~ # ssh localhostPassword: Last login: Thu Nov 23 22:19:06 2017 from localhostHave a lot of fun...laptop:~ # export DISPLAY=:0laptop:~ # xclockNo protocol specifiedError: Can't open display: :0laptop:~ # konsoleNo protocol specifiedSegmentation faultlaptop:~ # pycharmOpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0No protocol specifiedStart Failed: Failed to initialize graphics environment
You'd also see the same behaviour if you attempt the same in a text-mode console.
To address this issue open a new terminal from the graphics environment - if it is properly installed you should be able to run any of the X apps, including pycharm (or at least it shouldn't fail with that error).