英文:
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 "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: 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.<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)
答案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?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论