PyDev不断忘记解释器设置,日志中不断出现“未知编码:idna”。

huangapple go评论69阅读模式
英文:

Pydev keeps forgetting interpreter settings, "unknown encoding: idna" keeps showing up in logs

问题

每次我重新启动Eclipse时,我的Python3文件都不会打开,因为Eclipse说它们使用了错误的解释器设置。当我尝试解决解释器设置时,我发现我之前的所有配置都不在了,我必须设置一个新的解释器。每次都是如此。

我已经检查过,据我所知,Eclipse在Windows系统中写配置的所有位置都有写访问权限。我查看了日志,发现反复出现相同的错误:

- 错误输出:
Traceback (most recent call last):
  File "C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\pycompletionserver.py", line 6, in <module>
    from _pydevd_bundle.pydevd_constants import IS_JYTHON
  File "C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\_pydevd_bundle\pydevd_constants.py", line 32, in <module>
    _codecs.lookup(_codec)
LookupError: unknown encoding: idna

!STACK 0
java.lang.RuntimeException: 创建Python进程时出错 - 在创建套接字之前退出 - exitValue = (1).
ProcessInfo:

 - Executed: C:\Windows\py.exe -u C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\pycompletionserver.py 58747

有时当错误出现时,我还看到以下堆栈跟踪:

    at org.python.pydev.core.log.Log.log(Log.java:33)
    at org.python.pydev.ast.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:287)
    at org.python.pydev.ast.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:240)
    at org.python.pydev.ast.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:168)
    at org.python.pydev.ast.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:219)
    at org.python.pydev.ast.codecompletion.revisited.modules.CompiledModule.createTokensFromServer(CompiledModule.java:377)
    at org.python.pydev.ast.codecompletion.revisited.modules.CompiledModule.<init>(CompiledModule.java:180)
    at org.python.pydev.ast.codecompletion.revisited.modules.AbstractModule.createModule(AbstractModule.java:293)
    at org.python.pydev.ast.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:1038)
    at org.python.pydev.ast.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:869)
    at org.python.pydev.ast.codecompletion.revisited.SystemModulesManager.getModule(SystemModulesManager.java:400)
    at com.python.pydev.analysis.additionalinfo.AbstractAdditionalDependencyInfo.updateKeysIfNeededAndSave(AbstractAdditionalDependencyInfo.java:259)
    at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:171)
    at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:97)
    at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:83)
    at org.python.pydev.ast.codecompletion.revisited.SyncSystemModulesManager.synchronizeManagerToNameToInfoPythonpath(SyncSystemModulesManager.java:392)
    at org.python.pydev.ast.codecompletion.revisited.SyncSystemModulesManagerScheduler$SynchJob.run(SyncSystemModulesManagerScheduler.java:257)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
英文:

Every time I restart Eclipse, none of my python3 files open because eclipse says they use the wrong interpreter settings. When I go resolve the interpreter settings I see that none of the configuration I made is there, and I have to set a new interpreter. Every time.

I've checked and as far as I can tell Eclipse has write access to all the locations where it writes configuration to in my Windows system. I checked the logs, and see the same error repeated over and over:

 - Err output:
Traceback (most recent call last):
  File &quot;C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\pycompletionserver.py&quot;, line 6, in &lt;module&gt;
    from _pydevd_bundle.pydevd_constants import IS_JYTHON
  File &quot;C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\_pydevd_bundle\pydevd_constants.py&quot;, line 32, in &lt;module&gt;
    _codecs.lookup(_codec)
LookupError: unknown encoding: idna

!STACK 0
java.lang.RuntimeException: Error creating python process - exited before creating sockets - exitValue = (1).
ProcessInfo:

 - Executed: C:\Windows\py.exe -u C:\Users\me\.p2\pool\plugins\org.python.pydev.core_10.1.3.202301231743\pysrc\pycompletionserver.py 58747

I also see the following stack trace sometimes when the error appears:

	at org.python.pydev.core.log.Log.log(Log.java:33)
	at org.python.pydev.ast.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:287)
	at org.python.pydev.ast.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:240)
	at org.python.pydev.ast.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:168)
	at org.python.pydev.ast.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:219)
	at org.python.pydev.ast.codecompletion.revisited.modules.CompiledModule.createTokensFromServer(CompiledModule.java:377)
	at org.python.pydev.ast.codecompletion.revisited.modules.CompiledModule.&lt;init&gt;(CompiledModule.java:180)
	at org.python.pydev.ast.codecompletion.revisited.modules.AbstractModule.createModule(AbstractModule.java:293)
	at org.python.pydev.ast.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:1038)
	at org.python.pydev.ast.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:869)
	at org.python.pydev.ast.codecompletion.revisited.SystemModulesManager.getModule(SystemModulesManager.java:400)
	at com.python.pydev.analysis.additionalinfo.AbstractAdditionalDependencyInfo.updateKeysIfNeededAndSave(AbstractAdditionalDependencyInfo.java:259)
	at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:171)
	at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:97)
	at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:83)
	at org.python.pydev.ast.codecompletion.revisited.SyncSystemModulesManager.synchronizeManagerToNameToInfoPythonpath(SyncSystemModulesManager.java:392)
	at org.python.pydev.ast.codecompletion.revisited.SyncSystemModulesManagerScheduler$SynchJob.run(SyncSystemModulesManagerScheduler.java:257)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

答案1

得分: 1

从命令行来看,它说你已经配置了C:\Windows\py.exe作为Python解释器,这绝对是错误的。

所以,如果你配置了解释器,它应该修复idna问题。至于为什么信息没有持久保存,据我记得,我只见过这种情况的一种情况,那就是当用户使用Oomph来保存工作区设置,然后复制这些设置,但错误地将PyDev解释器设置保存为空值在Oomph中。你能检查一下这是否是你的情况吗?

英文:

From the command line it says that you've configured C:\Windows\py.exe an the python interpreter, which is definitely wrong.

So, if you configure the interpreter it should fix the idna issue. Now as to why it's not persisting the information, as far as I remember the only case where I've seen this was when a user was using Oomph to save workspace settings and then replicate those settings but then wrongly saved PyDev interpreter settings to nothing in Oomph. Can you check if this is your case?

huangapple
  • 本文由 发表于 2023年6月12日 20:02:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456473.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定