Eclipse PyDev completion hangs (yet again)

情到浓时终转凉″ 提交于 2019-12-04 04:34:01

What version of Java are you using?

If you are on Windows 7, later versions of Java (I think 6+) will default to IPv6. This is probably causing the problem as Python maybe wanting IPv4.

Anyway, since I had this problem I tried disabling

  • PyLint
  • Code Analysis

but it was still hanging.

Pal's answer about "ipv4 utilization" triggered my memory about another problem I had solved by "preferring" IPv4.

See http://docs.oracle.com/javase/1.4.2/docs/guide/net/ipv6_guide/

What you want to do is to edit your eclipse.ini and add "-Djava.net.preferIPv4Stack=true" in the vmargs section

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
...
-vmargs
-...
-Djava.net.preferIPv4Stack=true
...

I no longer get hangs.

Fabio Zadrozny

Is there any chance you can provide the code that's making that happen (and add it to a bug report see: http://pydev.org/about.html for links)?

I use PyDev daily with some very large projects and don't have that problem, so, it may be some specific construct or scenario in your code -- or maybe you just haven't given Eclipse enough memory (which would make the garbage collector work much more), in which case, take a look at: What are the best JVM settings for Eclipse? (in specific, raise your -Xmx flag, although you can probably use the other tips there too).

If you can't provide a reproducible scenario, the other choice would be getting a profiler (i.e.: YourKit java profiler has a 15 days free which would help in this case), running that use-case in the profiler and passing a snapshot of what's happening in this situation (if that's the case, please open a bug report at pydev.org and I can help you there).

I got this from pydev.org FAQs and it works fine for me.

When I do a code-completion, PyDev hangs, what can I do?

PyDev does most of its things in the java side, but some information can only be gotten from the python side (mainly builtins), so, in order to get that info, PyDev creates a shell and communicates with it through sockets.

The main problems when that happens are:

  1. There's a firewall blocking the communication to the shell

  2. In Linux, some kernels do not allow ipv4 utilization, which may make PyDev fail.

To enable it, do: echo 0 > /proc/sys/net/ipv6/bindv6only

  1. The timeout to connect is too smal.

It depends upon the "Timeout to connect to shell" in the code-completion preferences (window > preferences > PyDev > Code completion)

If nothing works, please report a bug (also, check if there is anything on the error log (window > show view > PDE Runtime > Error log) and on the eclipse '.log', which is located at the .metadata folder of the workspace location.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!