PyDev打开.py文件报错‘Failed to create the part's controls’问题解决
解决Ubuntu 20.04下Eclipse 2022-09升级PyDev 10.0.0后打开.py文件报错
Failed to create the part's controls的问题 问题场景
在Ubuntu 20.04系统的Eclipse 2022-09(4.25.0)中升级PyDev至10.0.0.20221001125版本后,打开.py文件时编辑器无内容显示,弹出错误提示:
Failed to create the part's controls
展开错误详情,核心报错栈信息为:
java.lang.AssertionError: Should never get here. Initial version: 2.7
问题原因
该问题由Eclipse配置使用Python 2.7解释器导致,PyDev 10.0.0版本已不再兼容Python 2.7环境。
解决方案
- 卸载系统中的Python 2.7:
sudo apt remove python2.7 sudo apt autoremove - 打开Eclipse,依次进入
Window > Preferences > PyDev > Interpreters > Python Interpreter - 在已配置的解释器列表中选中Python 2.7,点击
Remove按钮将其移除 - 点击
New按钮,添加系统中已安装的Python 3.x版本作为默认解释器 - 保存配置后重启Eclipse,即可正常打开
.py文件
内容的提问来源于stack exchange,提问作者IsaacS
相关产品推荐
相关产品推荐

