A-A+

PyCharm SyntaxError: Missing parentheses in call to ‘exec’

2020年04月23日 18:54 学习笔记 暂无评论 阅读 109 views 次

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

今天运行测试文件,发现pycharm报错。

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm2020\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_console_integration.py", line 4, in 
    from code import InteractiveConsole
ImportError: cannot import name 'InteractiveConsole' from 'code' (D:\xxxxx\xxxxx\code.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm2020\plugins\python\helpers\pydev\pydevd.py", line 37, in 
    from _pydevd_bundle.pydevd_comm import CMD_SET_BREAK, CMD_SET_NEXT_STATEMENT, CMD_STEP_INTO, CMD_STEP_OVER, \
  File "C:\Program Files\JetBrains\PyCharm2020\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 91, in 
    from _pydevd_bundle import pydevd_console_integration
  File "C:\Program Files\JetBrains\PyCharm2020\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_console_integration.py", line 6, in 
    from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
  File "C:\Program Files\JetBrains\PyCharm2020\plugins\python\helpers\pydev\_pydevd_bundle\pydevconsole_code_for_ironpython.py", line 305
    exec code in self.locals
            ^
SyntaxError: Missing parentheses in call to 'exec'

SyntaxError: Missing parentheses in call to 'exec'
此问题引起的原因主要是因为我这个文件的名字是code.py导致的,只要随便更改一个不冲突的名字即可。

布施恩德可便相知重

微信扫一扫打赏

支付宝扫一扫打赏

×
标签:

给我留言