Eclipse PyDev Autocomplete Issues

2019-08-09 00:39发布

问题:

I installed PyDev in Eclipse on my Mac. Whenever I am writing code, it has only a few suggestions and is seemingly incomplete. For example, whenever I type 'r', it only suggests "raise()" and "return()". However, all of the other functions that I would expect for it to suggest still execute at runtime.

This is the error:

Error connecting to python process. - the process in NOT ALIVE anymore (output=0) - ProcessInfo:

  • Executed: /usr/bin/python -u /Users//Downloads/eclipse 2/plugins/org.python.pydev_2.6.0.2012062818 /pysrc/pycompletionserver.py 52958 52957

  • Environment: APP_ICON_2099=../Resources/Eclipse.icns Apple_PubSub_Socket_Render=/tmp/launch- 4HHiSZ/Render COMMAND_MODE=unix2003 DISPLAY=/tmp/launch-hu6CLm/org.x:0 HOME=/Users/ JAVA_STARTED_ON_FIRST_THREAD_2099=1 LOGNAME= PATH=/usr/bin:/bin:/usr/sbin:/sbin PYTHONPATH=/Users//Downloads/ecli pse 2/plugins/org.python.pydev_2.6.0.2012062818 /pysrc/pydev_sitecustomize: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python26.zip: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/plat-darwin: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/plat-mac: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/plat-mac/lib- scriptpackages:/System/Library/Frameworks/Python. framework/Versions/2.6/Extras/lib/python: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/lib-tk: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/lib-old: /System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/lib-dynload: /System/Library/Frameworks/Python. framework/Versions/2.6/Extras/lib/python/PyObjC: /System/Library/Frameworks/Python. framework/Versions/2.6/Extras/lib/python/wx-2.8- mac-unicode SHELL=/bin/bash SSH_AUTH_SOCK=/tmp/launch-phfnZP/Listeners TMPDIR=/var/folders/Kr/Krv2afoAFMa79AvxnI73IE++ +TI/-Tmp-/ USER= __CF_USER_TEXT_ENCODING=0x1F5:0:0 com.apple.java.jvmTask=JNI

  • Working Dir: /Users//Downloads/eclipse 2/plugins/org.python.pydev_2.6.0.2012062818/pysrc

  • OS: Mac OS X

  • Std output: pycompletionserver will start pycompletionserver creating socket pycompletionserver received error: Traceback (most recent call last): File "/Users//Downloads/eclipse 2/plugins/org.python.pydev_2.6.0.2012062818 /pysrc/pycompletionserver.py", line 261, in run s.bind((HOST, self.thisPort)) File "", line 1, in bind gaierror: [Errno 8] nodename nor servname provided, or not known

  • Err output: Error connecting with parameters: host: localhost port: 52957 Exception in thread Thread-1: Traceback (most recent call last): File "/System/Library/Frameworks/Python. framework/Versions/2.6/lib/python2.6/threading.py", line 522, in __bootstrap_inner self.run() File "/Users//Downloads/eclipse 2/plugins/org.python.pydev_2.6.0.2012062818 /pysrc/pycompletionserver.py", line 261, in run s.bind((HOST, self.thisPort)) File "", line 1, in bind gaierror: [Errno 8] nodename nor servname provided, or not known

回答1:

i solved my Problem (was nearly the same):

i had

127.0.0.1 localhost

::1 localhost

written in my "hosts"-file:

HOW TO SOLVE:

  1. open Terminal
  2. sudo nano /etc/hosts
  3. enter password
  4. find both entries and comment them out with a "#" for example: #127.0.0.1 localhost #::1 localhost
  5. CTRL+X
  6. Y (on european Keyboard Z=Y)
  7. ENTER

=> Solved



回答2:

It seems that for some reason it's not being able to connect to 'localhost', this usually means some problem in your machine configuration.

Take a look at:

https://superuser.com/questions/207244/os-x-cant-resolve-localhost-suddenly

https://superuser.com/questions/142736/cant-resolve-localhost-on-mac-os-x-server

to see if that's your case... you can also try to edit:

/Users/tywhitehouse10/Downloads/eclipse 2/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydev_localhost.py

and make the function 'get_localhost' return '127.0.0.1' directly (but this is not a real solution, just a way to check if binding to the address directly instead of localhost works, as your localhost should definitely resolve properly).