我正在尝试使用pycharms从我的桌面远程运行一个opencv项目。我像这样设置远程解释器:enter image description here enter image description here
当我尝试运行脚本以打开带有摄像机实时供稿的窗口时,
export DISPLAY=":0";
有什么想法吗?
编辑----- 我正在Windows 10上使用vnc viewer来远程访问树莓派,并使用pycharm内置的ssh连接和同步文件。
EDIT2 ------
我在控制台中运行了ssh://pi@192.168.50.224:22/home/pi/.virtualenvs/cv/bin/python -u /home/pi/opencv_projects/tmp/pycharm_project_255/uvc_cam_feed_demo.py
Unable to init server: Could not connect: Connection refused
(Color Frame:1267): Gtk-WARNING **: cannot open display:
Process finished with exit code 1
,但在pycharms中仍然出现相同的错误,
Information:Groovyc: While compiling tests of alternativeworld: Conflicting module versions. Module [groovy-macro is loaded in version 2.5.3 and you are trying to load version 2.5.2
java.lang.ExceptionInInitializerError
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:74)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:161)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at groovy.grape.GrapeIvy.<clinit>(GrapeIvy.groovy:70)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at groovy.grape.Grape.getInstance(Grape.java:123)
at groovy.grape.Grape.grab(Grape.java:157)
at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:376)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:320)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:976)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:651)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:158)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:88)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-macro is loaded in version 2.5.3 and you are trying to load version 2.5.2
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:523)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:87)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:81)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModulesFrom(ExtensionModuleScanner.java:63)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:54)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:124)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
... 34 more
EDIT3 ------- 这是日志文件的原始转储。 https://pastebin.com/FY35DXqj