[pycharm remote python console]: “cannot connect t

2019-02-24 22:30发布

I configured a remote python interpreter for PyCharm and connected with SSH credentials. The whole setup works fine, except when I try to import any python library which uses Qt, such as pandas or matplotlib.

I put a screenshot of the remote python console with this error. When I separately ssh into the remote system the same import commands work fine.

please see this screen shot

I am using Anaconda on the remote server to install all python libraries. I checked the pyqt is installed too.

Can anyone help me figure this out?

1条回答
女痞
2楼-- · 2019-02-24 22:32

what worked is, I installed a GUI in the remote system. Then installed vnc and configured it by running vncserver. Which gives a display number, say 5.0. I then put the environment variable in PyCharm to DISPLAY=:5.0 in the project settings. That worked, and any plot command goes to that display, which I can view with vnc client.

There is still an error: Xlib: extension "RANDR" missing on display ":5.0" But as mentioned by @Hamish Moffatt, it can be ignored.

查看更多
登录 后发表回答