I am using Pycharm
2016.1
on CentOS7
and I am testing "Show command line afterwards
" and I got this Problem:
AttributeError: 'PyDevTerminalInteractiveShell' object has no attribute 'has_readline'
/usr/bin/python3.4 /usr/local/pycharm/helpers/pydev/pydev_run_in_console.py 37196 52554 /root/PycharmProjects/mytf/mytest/test5.py
Traceback (most recent call last):
File "/usr/local/pycharm/helpers/pydev/pydev_run_in_console.py", line 63, in <module>
interpreter = InterpreterInterface(host, int(client_port), threading.currentThread())
File "/usr/local/pycharm/helpers/pydev/_pydev_bundle/pydev_ipython_console.py", line 26, in __init__
self.interpreter = get_pydev_frontend(host, client_port, show_banner=show_banner)
File "/usr/local/pycharm/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 473, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd(show_banner=show_banner)
File "/usr/local/pycharm/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 303, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "/usr/lib/python3.4/site-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/IPython/terminal/interactiveshell.py", line 359, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/IPython/core/interactiveshell.py", line 487, in __init__
self.init_completer()
File "/usr/local/pycharm/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 222, in init_completer
self.Completer = self._new_completer_200()
File "/usr/local/pycharm/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 194, in _new_completer_200
use_readline=self.has_readline,
AttributeError: 'PyDevTerminalInteractiveShell' object has no attribute 'has_readline'
The way I managed to solve this problem without downgrading
iPython
was:1 - Download the following patch:
https://youtrack.jetbrains.com/_persistent/pycharm_ipython5_fix.patch?file=74-327779&c=true
2 - Inside
PyCharm
, create a new project located on:Pycharm
will prompt you to import the files on that folder, accept.3 - Click on VCS and choose Apply Patch
4 - Choose the file you've downloaded on step 1.
5 - The Apply Patch window will open, click OK
6 - Restart
PyCharm
The Python Console should be now working inside
PyCharm
PS: You can delete the project folder (.idea) you've created on Step 2
I solved my problem via installing ipython version 4.2:
It's solved in Pycharm 2016.2. See here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/207207329-ipython-5-not-supported-by-Pycharm-s-python-console-
This PyCharm issue occurs because of changes the the
iPython
api withiPython
version 5. Until Jetbrains fix this, reverting to an earlier version ofiPython
(version 4) will correct this. As @chenfei has discovered, this can be done throughpip
:Edit
And if you can't wait that long, Jetbrains have released a patch
https://youtrack.jetbrains.com/issue/PY-20013#comment=27-1512407
Final Edit
This issue has been fixed in PyCharm 2016.2