本文介绍了使用PyDev /错误初始化控制台在Eclipse中运行时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中使用PyDev控制台,最初工作正常。 Python代码将在控制台内部运行。
当我开始在PyDev模块中编写文件时,我尝试执行runfile(),但已经使用python初始化的控制台返回此错误:

 无法解析服务器的响应:预期的methodResponse元素,得到head127.0.0.1  -   -  [18 / Jul / 2015 13:55:14]代码400,消息错误HTTP / 0.9请求类型(' POST')

之后,我关闭了控制台并重新启动了Eclipse。现在,当我尝试甚至初始化pyDev控制台时,它返回:

 初始化控制台时出错。 

连接到控制台的意外错误。

无法从pydevconsole回收适当的Hello响应。最后收到的msg:无法解析服务器的响应:预期的methodResponse元素,得到头

命令行使用:



C:\Users\axelrod\AppData\Local\Continuum\Anaconda\python.exe -u C: \Users\axelrod\Applications\eclipse\plugins\org.python.pydev_4.2.0.201507041133\pysrc\pydevconsole.py 50824 50825 50824 50825



环境



PATH = C:/ Program Files / Java / jre1.8.0_51 / bin / server; C:/ Program文件/ Java / jre1.8.0_51 / bin; C:/ Program Files / Java / jre1.8.0_51 / lib / amd64; C:\ProgramData\Oracle\Java\javapath; C:\Program Files\\ \\ Dell\DW WLAN Card ;; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1 .0\; C:\程序文件(x86)\QuickTime\QTSystem\; C:\Program Files\\ \\ CREDANT\Shield v7.3\; C:\Users\axelrod\AppData\Local\Continuum\Anaconda; C:\Users\axelrod\AppData\Local\Continuum\\ \\Anaconda\Scripts; C:\Users\axelrod\Applications\eclipse;



LOCALAPPDATA = C:\Users\axelrod\AppData\\ \\本地



PROCESSOR_LEVEL = 6



SYSTEMDRIVE = C:



FP_NO_HOST_CHECK = NO



COMMONPROGRAMFILES(X86)= C:\程序文件(x86)\常规文件



USERDOMAIN = CHAPMANEDU



LOGONSERVER = \ORDC01



LDMS_LOCAL_DIR = C:\Program文件(x86)\LANDesk\LDClient\Data



PROMPT = $ P $ G



SESSIONNAME =控制台



ALLUSERSPROFILE = C:\ProgramData



PROGRAMFILES(X86)= C:\Program Files (x86)



PROCESSOR_ARCHITECTURE = AMD64



ASL.LOG = Destination = file



DEFLOGDIR = C:\ProgramData\McAfee\DesktopProtection



WINDOWS_TRACING_FLAGS = 3



PROGRAMFILES = C:\程序文件



APPDATA = C:\Users\axelrod\AppData\Roaming



PSMODULEPATH = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\



PROGRAMW6432 = C:\Program Files



PROGRAMDATA = C:\ProgramData



SYSTEMROOT = C :\Windows



USERNAME = axelrod



VSEDEFLOGDIR = C:\ProgramData\McAfee\DesktopProtection



USERDNSDOMAIN = CHAPMAN.EDU



PYTHONPATH = C:\Users\axelrod\Applications\ eclipse\plugins\org.python.pydev_4.2.0.201507041133\pysrc\pydev_sitecustomize; C:\Users\axelrod\AppData\Local\Continuum\Anaconda\DLLs; C:\ Users\axelrod\AppData\Local \Continuum\Anaconda\lib; C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\lib-TK; C:\Users\axelrod\AppData \Local\Continuum\Anaconda; C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-包; C:\Users\axelrod\AppData \Local\Continuum\Anaconda\lib\site-packages\Sphinx-1.3.1-py2.7.egg; C:\Users\axelrod\AppData\Local\Continuum\ Anaconda\lib\site-packages\cryptography-0.9.1-py2.7共赢-amd64.egg; C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib \site-packages\win32; C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\win32\lib; C:\Users\\ \\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\Pythonwin; C:\Users \\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\setuptools-17.1.1-py2.7.egg; C:\Users\axelrod\Desktop\ECLIPSE WORKSPACE\IntroPythonDataAnalysis\src



PATHEXT = .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS; .JSE; .WSF ; .WSH; .MSC



OS = Windows_NT



COMPUTERNAME = ENG-AXELROD5520



COMMONPROGRAMW6432 = C:\Program Files\Common Files



COMMONPROGRAMFILES = C:\Program Files\Common Files

COMSPEC = C:\Windows\system32\cmd.exe



PROCESSOR_REVISION = 2a07



CLASSPATH =; C:\程序文件(x86)\QuickTime\QTSystem\QTJava.zip



WINDIR = C:\Windows



HOMEPATH = \Users\axelrod



TEMP = C:\\ \\Users\axelrod\AppData\Local\Temp



HOMEDRIVE = C:



PROCESSOR_IDENTIFIE R = Intel64 Family 6 Model 42 Stepping 7,GenuineIntel



USERPROFILE = C:\Users\axelrod



WINDOWS_TRACING_LOGFILE = C:\BVTBin\Tests\installpackage\csilogfile.log



TMP = C:\Users\axelrod\AppData\Local \Temp



PUBLIC = C:\Users\Public



NUMBER_OF_PROCESSORS = 4



QTJAVA = C:\程序文件(x86)\QuickTime\QTSystem\QTJava.zip



PYTHONIOENCODING = UTF-8



PYDEV_UMD_ENABLED = true



PYDEV_UMD_NAMELIST = guidata,guiqwt



PYDEV_UMD_VERBOSE = true

解决方案

一个解决方案是使用Liclipse,它附带了python集成,要做的是配置解释器。或检查您的解释器配置正确的天气。该配置位于Window-> Preferences-> Pydev-> Intrepreters。或者另一件可能是错误的事情是,pydev模块可能是某种类型的eclipse。我个人使用的是很好的LiClipse。


Using a PyDev console in Eclipse, which initially worked fine. Python code would work inside the console.When I started writing a file within a PyDev module, I tried executing runfile() but the console that had already initialized with python returns this error:

Failed to parse server's response: Expected methodResponse element, got head127.0.0.1 - - [18/Jul/2015 13:55:14] code 400, message Bad HTTP/0.9 request type ('POST')

After which, I closed the console and restarted Eclipse. Now, when I try to even initialize the pyDev console it returns this:

Error initializing console.

Unexpected error connecting to console.

Failed to recive suitable Hello response from pydevconsole. Last msg received: Failed to parse server's response: Expected methodResponse element, got head

Command Line used:

C:\Users\axelrod\AppData\Local\Continuum\Anaconda\python.exe -u C:\Users\axelrod\Applications\eclipse\plugins\org.python.pydev_4.2.0.201507041133\pysrc\pydevconsole.py 50824 50825 50824 50825

Environment:

PATH=C:/Program Files/Java/jre1.8.0_51/bin/server;C:/Program Files/Java/jre1.8.0_51/bin;C:/Program Files/Java/jre1.8.0_51/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Dell\DW WLAN Card;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\CREDANT\Shield v7.3\;C:\Users\axelrod\AppData\Local\Continuum\Anaconda;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\Scripts;C:\Users\axelrod\Applications\eclipse;

LOCALAPPDATA=C:\Users\axelrod\AppData\Local

PROCESSOR_LEVEL=6

SYSTEMDRIVE=C:

FP_NO_HOST_CHECK=NO

COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files

USERDOMAIN=CHAPMANEDU

LOGONSERVER=\ORDC01

LDMS_LOCAL_DIR=C:\Program Files (x86)\LANDesk\LDClient\Data

PROMPT=$P$G

SESSIONNAME=Console

ALLUSERSPROFILE=C:\ProgramData

PROGRAMFILES(X86)=C:\Program Files (x86)

PROCESSOR_ARCHITECTURE=AMD64

ASL.LOG=Destination=file

DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection

WINDOWS_TRACING_FLAGS=3

PROGRAMFILES=C:\Program Files

APPDATA=C:\Users\axelrod\AppData\Roaming

PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

PROGRAMW6432=C:\Program Files

PROGRAMDATA=C:\ProgramData

SYSTEMROOT=C:\Windows

USERNAME=axelrod

VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection

USERDNSDOMAIN=CHAPMAN.EDU

PYTHONPATH=C:\Users\axelrod\Applications\eclipse\plugins\org.python.pydev_4.2.0.201507041133\pysrc\pydev_sitecustomize;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\DLLs;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\lib-tk;C:\Users\axelrod\AppData\Local\Continuum\Anaconda;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\Sphinx-1.3.1-py2.7.egg;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\cryptography-0.9.1-py2.7-win-amd64.egg;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\win32;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\win32\lib;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\Pythonwin;C:\Users\axelrod\AppData\Local\Continuum\Anaconda\lib\site-packages\setuptools-17.1.1-py2.7.egg;C:\Users\axelrod\Desktop\ECLIPSE WORKSPACE\IntroPythonDataAnalysis\src

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

OS=Windows_NT

COMPUTERNAME=ENG-AXELROD5520

COMMONPROGRAMW6432=C:\Program Files\Common Files

COMMONPROGRAMFILES=C:\Program Files\Common Files

COMSPEC=C:\Windows\system32\cmd.exe

PROCESSOR_REVISION=2a07

CLASSPATH=.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip

WINDIR=C:\Windows

HOMEPATH=\Users\axelrod

TEMP=C:\Users\axelrod\AppData\Local\Temp

HOMEDRIVE=C:

PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel

USERPROFILE=C:\Users\axelrod

WINDOWS_TRACING_LOGFILE=C:\BVTBin\Tests\installpackage\csilogfile.log

TMP=C:\Users\axelrod\AppData\Local\Temp

PUBLIC=C:\Users\Public

NUMBER_OF_PROCESSORS=4

QTJAVA=C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip

PYTHONIOENCODING=UTF-8

PYDEV_UMD_ENABLED=true

PYDEV_UMD_NAMELIST=guidata,guiqwt

PYDEV_UMD_VERBOSE=true

解决方案

One solution is to use Liclipse, which comes with python integration, all you have to do is to configure the interpreter. Or check weather your interpreter is configured correctly. The configuration is found at Window->Preferences->Pydev->Intrepreters. Or another thing that might be wrong is that the pydev module might be for a certain type of eclipse. I personally use LiClipse which is great.

这篇关于使用PyDev /错误初始化控制台在Eclipse中运行时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 03:09