在win10上使用Pycharm远程开发报错:
ssh://usr1@10.xxx.xxx.xxx:0.0/usr/bin/python3.6 -u /home/usr1/abc.py
^C: cannot connect to X server 10.xxx.xxx.xxx:0.0
Process finished with exit code 1
代码:本地代码很简单,就是调用服务器cv2显示图片,但是运行相同的代码:本地死活显示不了,服务器可以显示。
import cv2
def fun1(img_dir):
img = cv2.imread(img_dir, 0)
while 1:
cv2.imshow("img1", img)
if cv2.waitKey(1) == 27: # press esc button to exit
break
cv2.destroyAllWindows()
return img
img_dir = '/home/usr1/1.jpg'
fun1(img_dir)
原因: 该死的代理软件!!!!!!!!!!!!!!!
解决:
如果你跟我一样是使用公司VPN上网,可以先看看是不是在装了公司VPN的同时还安装了其他FQ或代理软件(