Pycharm Startup Error: Unable to detect graphics environment

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 localhost
Password: 
Last login: Thu Nov 23 22:19:06 2017 from localhost
Have a lot of fun...
laptop:~ # export DISPLAY=:0
laptop:~ # xclock
No protocol specified
Error: Can't open display: :0
laptop:~ # konsole
No protocol specified
Segmentation fault
laptop:~ # pycharm
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
No protocol specified

Start 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).


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.


In fedora
I have installed pycharm using fedy. This is worked.
Or change to a another user and try except root.
Phpstrom, Webstrom, PyCharm
Above three of them worked same like that.