Pycharm python console socket.gaierror

Ivan Peng

I'm running Pycharm 4.5.3 on OS X Yosemite (10.10.3). I created a simple python program, and tried opening the python console, and got this stack trace error:

/usr/bin/python -u /Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py 59286 59287
Error starting server with host: localhost, port: 59286, client_port: 59287
Unhandled exception in thread started by <function start_server at 0x100d9bd70>
Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py", line 283, in start_server
    server = XMLRPCServer((host, port), logRequests=False, allow_none=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SimpleXMLRPCServer.py", line 593, in __init__
    SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 419, in __init__
    self.server_bind()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 430, in server_bind
    self.socket.bind(self.server_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
Couldn't connect to console process.

A similar question was raised here on stack overflow, but the root of the error was the string localhost passed in with white spaces, which is not the case here (host has been assigned to 'localhost'). Does anyone have any idea? This isn't really a big deal, seeing as I can use python command line in terminal, but I'm curious if this is a bug within Pycharm.

Edit: here's the source code to the Pycharm script.

if __name__ == '__main__':
    import pydevconsole
    sys.stdin = pydevconsole.BaseStdIn()
    port, client_port = sys.argv[1:3]
    import pydev_localhost

    if int(port) == 0 and int(client_port) == 0:
        (h, p) = pydev_localhost.get_socket_name()

        client_port = p

    pydevconsole.StartServer(pydev_localhost.get_localhost(), int(port), int(client_port))
cs_stackX

The answers given so far do not get at the underlying cause, which is likely to be that your OS X /etc/hosts file does not contain an entry for: 127.0.0.1 localhost

Update the hosts file with the line: 127.0.0.1 localhost (you will need to use sudo), then restart pyCharm. Unless you know what you are doing, editing your IDE source code is not a good idea.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Python - Telnetlib socket.gaierror:

From Dev

socket.gaierror when trying to run emr using python mrjob

From Dev

getaddrinfo failed with socket.gaierror[11001] (python) (mqtt)

From Dev

pycharm python console single instance

From Dev

Python requests multithreading "Max Retries exceeded with url" Caused by <class 'socket.gaierror'>

From Dev

Python socket.py gaierror when trying to use Google Maps API

From Dev

socket.gaierror: Errno 11004 getaddrinfo failed

From Java

pycharm does not connect to console with python3.8

From Dev

Python console doesn't get updated (with PyCharm)

From Dev

pycharm does not connect to console with python3.8

From Dev

Change default Python / Flask Console in PyCharm

From Dev

Why am I getting socket.gaierror with httplib?

From Dev

socket.gaierror: [Errno -2] Name or service not known

From Dev

Server connection issue: "socket.gaierror: [Errno 11004] getaddrinfo failed"

From Dev

socket.gaierror: [Errno 8] nodename nor servname provided, or not known

From Dev

Why am I getting socket.gaierror with httplib?

From Dev

How to automatically switch focus to python console when running script in Pycharm?

From Dev

pycharm - keep focus in editor when sending commands to python console

From Dev

How to page up/down in PyCharm's Python console?

From Dev

How to give the Python console in PyCharm access to the variable space of a script?

From Dev

Pycharm IPython tab completion not working (within python console)

From Dev

How to turn off the "Special Variables" window in Python Console of PyCharm?

From Dev

PyCharm running Python file always opens a new console

From Dev

How to automatically switch focus to python console when running script in Pycharm?

From Dev

Pycharm: different behavior between run and run in Python console?

From Dev

How to wrap up outputs in Python console within PyCharm?

From Dev

socket.connect() gives socket.gaierror: [Errno 11004] getaddrinfo failed

From Dev

Pycharm console is blank

From Dev

PyCharm: attach console to debugger

Related Related

  1. 1

    Python - Telnetlib socket.gaierror:

  2. 2

    socket.gaierror when trying to run emr using python mrjob

  3. 3

    getaddrinfo failed with socket.gaierror[11001] (python) (mqtt)

  4. 4

    pycharm python console single instance

  5. 5

    Python requests multithreading "Max Retries exceeded with url" Caused by <class 'socket.gaierror'>

  6. 6

    Python socket.py gaierror when trying to use Google Maps API

  7. 7

    socket.gaierror: Errno 11004 getaddrinfo failed

  8. 8

    pycharm does not connect to console with python3.8

  9. 9

    Python console doesn't get updated (with PyCharm)

  10. 10

    pycharm does not connect to console with python3.8

  11. 11

    Change default Python / Flask Console in PyCharm

  12. 12

    Why am I getting socket.gaierror with httplib?

  13. 13

    socket.gaierror: [Errno -2] Name or service not known

  14. 14

    Server connection issue: "socket.gaierror: [Errno 11004] getaddrinfo failed"

  15. 15

    socket.gaierror: [Errno 8] nodename nor servname provided, or not known

  16. 16

    Why am I getting socket.gaierror with httplib?

  17. 17

    How to automatically switch focus to python console when running script in Pycharm?

  18. 18

    pycharm - keep focus in editor when sending commands to python console

  19. 19

    How to page up/down in PyCharm's Python console?

  20. 20

    How to give the Python console in PyCharm access to the variable space of a script?

  21. 21

    Pycharm IPython tab completion not working (within python console)

  22. 22

    How to turn off the "Special Variables" window in Python Console of PyCharm?

  23. 23

    PyCharm running Python file always opens a new console

  24. 24

    How to automatically switch focus to python console when running script in Pycharm?

  25. 25

    Pycharm: different behavior between run and run in Python console?

  26. 26

    How to wrap up outputs in Python console within PyCharm?

  27. 27

    socket.connect() gives socket.gaierror: [Errno 11004] getaddrinfo failed

  28. 28

    Pycharm console is blank

  29. 29

    PyCharm: attach console to debugger

HotTag

Archive