gpt4 book ai didi

python - Pycharm Debug模式语法错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:46:54 26 4
gpt4 key购买 nike

在运行 PyCharm 社区版时,我突然开始在运行 Debug模式时遇到此语法错误。我尝试重新安装 PyCharm 但没有成功解决该错误。有人以前见过这个吗?

Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 26, in <module>
from _pydevd_bundle.pydevd_additional_thread_info import PyDBAdditionalThreadInfo
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_additional_thread_info.py", line 19, in <module>
from _pydevd_bundle.pydevd_additional_thread_info_regular import PyDBAdditionalThreadInfo # @UnusedImport
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_additional_thread_info_regular.py", line 5, in <module>
from _pydevd_bundle.pydevd_frame import PyDBFrame
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_frame.py", line 10, in <module>
from _pydevd_bundle.pydevd_breakpoints import get_exception_breakpoint
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_breakpoints.py", line 15, in <module>
from _pydevd_bundle.pydevd_comm import get_global_debugger
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 75, in <module>
import pydevconsole
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 10, in <module>
from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevconsole_code_for_ironpython.py", line 105
except SyntaxError, err:
^
SyntaxError: invalid syntax

最佳答案

如果您不关心任何项目特定配置或运行配置:

  1. 退出 pycharm
  2. 删除项目文件夹中的.idea文件夹
  3. 启动pycharm

昨晚深夜遇到此问题时,我使用此方法作为快速修复解决方案。但是,此解决方案的本质表明此问题是由 .idea 文件夹中的某些损坏引起的。如果我再次遇到这个问题,我会建议采用不同的方法:

  1. 首先,尝试在 .idea 文件夹中的文件中搜索错误文本
  2. 如果上一步失败:
    1. 退出 pycharm
    2. 将项目文件夹内的.idea文件夹移动到安全位置
    3. 启动 pycharm 创建一个新的 .idea 文件夹并再次退出
    4. 在新旧 .idea 文件夹之间执行三向合并
    5. 启动pycharm

关于python - Pycharm Debug模式语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46165868/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com