gpt4 book ai didi

python - 属性错误 : module 'builtins' has no attribute 'interpreter'

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

我想这是一个基本问题。我可以在 Pycharm 2018.1 Python 3.6.5 中运行我的程序。但是当我在 Debug模式下运行并打开 python 控制台时,当我尝试键入任何 python 命令时,我会收到此错误消息。

我正在使用 virtualenv 并在项目设置中添加了解释器。

我想知道我的配置有什么问题

下面是堆栈跟踪

Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 362, in get_interpreter
interpreterInterface = getattr(__builtin__, 'interpreter')
AttributeError: module 'builtins' has no attribute 'interpreter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1443, in do_it
result = pydevconsole.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 467, in console_exec
need_more = exec_code(CodeFragment(expression), updated_globals, frame.f_locals, dbg)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 383, in exec_code
interpreterInterface = get_interpreter()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 364, in get_interpreter
interpreterInterface = InterpreterInterface(None, None, threading.currentThread())
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console.py", line 24, in __init__
self.interpreter = get_pydev_frontend(host, client_port)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 461, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 310, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "/Users/hobart/envs/pys/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/Users/hobart/envs/pys/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 430, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "/Users/hobart/envs/pys/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 516, in __init__
self.init_completer()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 234, in init_completer
self.Completer = self._new_completer_500()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 196, in _new_completer_500
parent=self
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 87, in __init__
self.matchers.remove(self.python_matches)
ValueError: list.remove(x): x not in list

最佳答案

这是在您提出问题几天后修复的:https://youtrack.jetbrains.com/issue/PY-29313
您应该将 PyCharm 更新到 2018.1.1 或更高版本。

关于python - 属性错误 : module 'builtins' has no attribute 'interpreter' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49705338/

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