Exception in XML-RPC listener loop (java.net.SocketException: Socket closed).

When I run PyCharm from bash , I get this error..As result: I cant't use python-console in pycharm Anybody know how to fix it ? 
OS: ubuntu 16.04
Hi I had the same problem as you. I solved the problem by making the line 127.0.0.1 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.
How to fix python console error in pycharm?