Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm console cannot connect after update

I just updated Pycharm and everything works except the "Python Console" that gives the following error:

"/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py" 52830 52831

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 526, in <module>
    pydevconsole.start_server(host, int(port), int(client_port), client_host)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevconsole.py", line 347, in start_server
    interpreter = InterpreterInterface(client_host, client_port, 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/kiarash/anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users/kiarash/anaconda/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 430, in __init__
    super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
  File "/Users/kiarash/anaconda/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

Process finished with exit code 1
like image 245
KiaSh Avatar asked Apr 03 '18 11:04

KiaSh


2 Answers

A patch has been committed on GitHub (https://github.com/JetBrains/intellij-community/commit/d9f32f650b5a1f4e7a9646011da415d27e18a210)

You can also apply the patch your self, file path:

<PyCharm Root>/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py

Modify:

     class PyDevIPCompleter(IPCompleter):

     def __init__(self, *args, **kwargs):
         """ Create a Completer that reuses the advanced completion support of PyDev
             in addition to the completion support provided by IPython """
         IPCompleter.__init__(self, *args, **kwargs)
         # Use PyDev for python matches, see getCompletions below
-        self.matchers.remove(self.python_matches)
+        if self.python_matches in self.matchers:
+            # `self.python_matches` matches attributes or global python names
+            self.matchers.remove(self.python_matches)
like image 78
Anh-Khoa Avatar answered Oct 11 '22 10:10

Anh-Khoa


i found that ipython is the problem ipython(6.3.0) was updated but you should downgrade to ipython (6.2.0) if you want to use pycharm now

like image 24
김병모 Avatar answered Oct 11 '22 11:10

김병모