Python Console starts with error message in PyCharm, not able to use it afterwards


Since some version I have the following error message in the Python console with my projects:

I am running Debian Testing:

/usr/bin/python2.7 /home/richard/apps/pycharm/helpers/pydev/ 43565 37175
Python 2.7.12+ (default, Aug  4 2016, 20:04:34)
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
PyDev console: using IPython 2.4.1

import sys; print('Python %s on %s' % (sys.version, sys.platform))

Python 2.7.12+ (default, Aug  4 2016, 20:04:34)
[GCC 6.1.1 20160724] on linux2
Traceback (most recent call last):
  File "/home/richard/apps/pycharm/helpers/pydev/_pydev_bundle/", line 245, in add_exec
  File "/home/richard/apps/pycharm/helpers/pydev/_pydev_bundle/", line 438, in finish_exec
    return server.NotifyFinished(more)
  File "/usr/lib/python2.7/", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/", line 1602, in __request
  File "/usr/lib/python2.7/", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/", line 1311, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/", line 1459, in send_content
  File "/usr/lib/python2.7/", line 1053, in endheaders
  File "/usr/lib/python2.7/", line 897, in _send_output
  File "/usr/lib/python2.7/", line 859, in send
  File "/usr/lib/python2.7/", line 836, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused

I tried both normal python and ipython settings.

If I start pycharm from cmd I see the following:

richard@kwik~/apps/pycharm/bin$ ./
[  12109]   WARN - napi.components.ServiceManager - com.jetbrains.python.console.PythonConsoleRunnerFactory requested as a service, but it is a component - convert it to a service or change call to ApplicationManager.getApplication().getComponent()


Any clue?





Comment actions Permalink

Hi Richard! Do you have a firewall enabled on your system?

Comment actions Permalink

Hi Elizabeth,

nope, and I'm working from different working places (with and without corporate firewalls)

and I have not seen it work for some versions now.




Comment actions Permalink

Hi I had the same problem as you. I solved the problem by making the line localhost as the first line in /etc/hosts. The reason python console does not run is that python console tries to connect to localhost:pycharm-port, but localhost was resolved to the IPv6 addess of ::1, and the connection is refused.


Please sign in to leave a comment.