project interpreter from virtual env not working in debug mode
Answered
Hi all,
I use pycharm 5.0.4. And have an anaconda env for rllab (@ ~/anaconda2/envs/rllab3/bin/pytho).
I have configured the project interprter to use ~/anaconda2/envs/rllab3/bin/python and normal running of code works.
However, when I try to debug, halt at a breakpoint and try do to anything on the console (e.g. a simpe print 'Hello'), I get:
Traceback (most recent call last):
File "~/pycharm-community-5.0.4/helpers/pydev/pydevconsole.py", line 339, in get_interpreter
interpreterInterface = getattr(__builtin__, 'interpreter')
AttributeError: module 'builtins' has no attribute 'interpreter'
How ca I solve this?
Thx
Alex
Please sign in to leave a comment.
Hi Alex, thank you for the report. Is it the full error traceback? If not, could you please provide it or attach a screenshot with it?
I'm getting a very similar issue.
PyCharm 2019.1.4 (Community Edition)
Build #PC-191.8026.44, built on July 30, 2019
JRE: 11.0.2+9-b159.64 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 79, in get_code_executor
code_executor = 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 1466, in do_it
result = pydevd_console_integration.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 180, in console_exec
need_more = exec_code(CodeFragment(expression), updated_globals, frame.f_locals, dbg)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 93, in exec_code
code_executor = get_code_executor()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 81, in get_code_executor
code_executor = CodeExecutor()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_code_executor.py", line 24, in __init__
self.interpreter = get_pydev_frontend(rpc_client)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 462, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 311, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 459, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 667, in __init__
self.init_history()
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 1797, in init_history
self.history_manager = HistoryManager(shell=self, parent=self)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/history.py", line 537, in __init__
**traits)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/history.py", line 229, in __init__
self.init_db()
File "</Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/decorator.py:decorator-gen-15>", line 2, in init_db
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/history.py", line 87, in catch_corrupt_db
return f(self, *a, **kw)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/history.py", line 254, in init_db
self.db = sqlite3.connect(self.hist_file, **kwargs)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/traitlets/traitlets.py", line 585, in __set__
self.set(obj, value)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/traitlets/traitlets.py", line 574, in set
obj._notify_trait(self.name, old_value, new_value)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/traitlets/traitlets.py", line 1139, in _notify_trait
type='change',
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/traitlets/traitlets.py", line 1176, in notify_change
c(change)
File "/Users/danieldavella/miniconda3/envs/django-2.2.1/lib/python3.6/site-packages/IPython/core/history.py", line 198, in _db_changed
raise TraitError(msg)
traitlets.traitlets.TraitError: HistoryManager.db must be sqlite3 Connection or DummyDB, not <SqliteConnection at 0x111d58288 for sqlite3.Connection at 0x113542e30>
Uninstalling IPython from my test environment seemed to make things work, so maybe that's the issue?