开发者

Eclipse PyDev completion hangs (yet again)

I'm using PyDev in Eclipse as my Python editor. It's fine in terms of feature set. Everything works fine except for one very annoying thing:

Code completion itself works fast. When I press Alt+Space, the window pops out almost instantly and all the options are there. The option at the top is selected. Then comes the trouble. The detailed description won't appear until about 5-10 seconds. All this time CPU is working at maximum load and the interface is not responding. All the processor is consumed by the Eclipse Java process (the spawned Python process seems idle). Then a yellow window pops up, and all it contains i开发者_开发知识库s just a Python code of a selected function/variable. All consecutive details are displayed instantly. The procedure repeats when I close the completion window (for example by accepting one of the options and asking for completion again). This drives me crazy.

I've tried so far:

  • creating a whole new workspace,
  • creating an Eclipse/PyDev project from scratch,
  • tweaking JVM to make sure it has loads of memory,
  • making sure the right JVM is chosen (the latest Oracle JVM available),
  • making sure Python process communicates freely with the Java instance (I read about possible problems with that, but it seems not to be the issue).
  • making sure all the installed plugins are up to date.

The version I use is Eclipse Helios, because the last time I checked certain extensions weren't yet ported to the latest one.

Has anyone observed a similar issue? Was anyone able to get around it? General ideas on how to debug it and file a sensible bug report possibly? Other things worth checking for.

Any workaround less drastic than turning completion off completly?

Thanks!

EDIT:

I've also noticed a problem with a similar popup window in HTML/CSS editor. It looked somewhat similar (a yellow window, with some text inside) and it also took ages to display. Don't really know if that is related, but could be.

EDIT(2):

Ok, No I've started with a fresh install of the newest Eclipse Indigo, without any additional plugins apart from PyDev and the issue remains. Seems like I'll have to look for a new IDE.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜