Pycharm remote server cannot display pictures

Pycharm remote server cannot display pictures

###################Update 2021/01/17####################### ####
In the case of pycharm remote server, it can be displayed directly with plt and can only be displayed in SciView. When the Show plots in tool window in File -> setting -> Tools -> Python Scientific is removed, it cannot be displayed locally. The same independent pop-up window.
The author found a lot of tutorials and finally solved it. You can use cv2.imshow or plt.imshow to pop-up windows independently, but only in .py with the relevant environment variables configured, and run through pycharm or through some terminal tools, ex. Putty. Input code in python console or input command in Terminal, it can not be displayed. In fact, the reason is that the relevant DISPLAY variable is not configured.

Pycharm realizes that the remote server displays pictures locally and pops up independent windows

1. Download Putty (it can also be Xshell, but it seems to need to be cracked, it is a paid software), Xming, and complete the relevant configuration, refer to the blog Pycharm remote connection server local display independent plot window
2. After the configuration is complete, the author still cannot pop up A separate window shows the error Cannot load library /home/ban/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory) , refer to the blog Ubuntu16.04 Python program error qt.qpa.plugin: Could not load the Qt platform plugin xcb solution
3. When sudo apt-get install libxcb-xinerama0, the error still occurs Error E: Unable to locate package libxcb-xinerama0 , refer to the solution of the blog ubuntu-E: Encountered a section with no Package: header , and then execute sudo apt-get install libxcb-xinerama0 to solve it.
Note : The author has also modified the ForwardAgent and ForwardX11 in /etc/ssh/ssh_config, both of which are changed to yes.
Insert picture description here
However, the author is not sure whether this is necessary or not. The modification method is to use the command

//
vi /etc/ssh/ssh_config

For specific editing methods, please refer to the blog linux system enter vi ***After editing the configuration, save and exit steps
############################# ############################ The
author recently used pycharm remote server for deep learning, and found that for cv2.imshow, pycharm could not display the server picture of. Related blogs generally talk about configuring environment variables, xming, x11, etc. related to DISPLAY variables and x server.

Its practical matplotlib.pyplot can be displayed directly in SciView: and input code in the python console can also be displayed in SciView

// 
import matplotlib.pyplot as plt
plt.imshow(img)
plt.show()

Guess you like

Origin blog.csdn.net/qq_35898332/article/details/110148939
Recommended