Search code examples
pythonconsolepycharmvpython

After using Vpython, couldn't connect to console process in Pycharm


I am using Pycharm which worked perfectly well for over a couple of months. I recently used Vpython for an animation, which opened a new tab in the active Chrome video (with localhost:<port number> as the address) to run the animation when called. This all went well, but after having used it, whenever I try to open the console via pycharm, it doesn't work with the following error.

C:\Users\abc\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\pydevconsole.py" 62780 62781
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\pydevconsole.py", line 517, in <module>
    pydevconsole.start_server(host, int(port), int(client_port), client_host)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\pydevconsole.py", line 338, in start_server
    interpreter = InterpreterInterface(client_host, client_port, threading.currentThread())
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console.py", line 24, in __init__
    self.interpreter = get_pydev_frontend(host, client_port)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 494, in get_pydev_frontend
    _PyDevFrontEndContainer._instance = _PyDevFrontEnd()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 326, in __init__
    self.ipython = PyDevTerminalInteractiveShell.instance()
  File "C:\Users\Thesatwik13\AppData\Local\Programs\Python\Python36-32\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "C:\Users\Thesatwik13\AppData\Roaming\Python\Python36\site-packages\IPython\terminal\interactiveshell.py", line 430, in __init__
    super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
  File "C:\Users\Thesatwik13\AppData\Roaming\Python\Python36\site-packages\IPython\core\interactiveshell.py", line 516, in __init__
    self.init_completer()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 246, in init_completer
    self.Completer = self._new_completer_500()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 208, in _new_completer_500
    parent=self
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 89, in __init__
    self.matchers.remove(self.python_matches)
ValueError: list.remove(x): x not in list
Process finished with exit code 1
Couldn't connect to console process.

I can run python via command prompt and from outside Pycharm. The chrome tab Vpython script runs perfectly well still.I tried restarting pycharm and the computer, but I actually have no clue about the problem here. I am using Windows 10.

PS: Went through multiple problems of this sort on this site. But non had a list.remove(x) x not in list type problem.


Solution

  • The problem is caused by IPython 6.3.0 version (ticket in PyCharm bug tracker: PY-29313). Either update PyCharm or IPython (6.3.1 works fine).