Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 is 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.

like image 802
julx Avatar asked Sep 18 '11 18:09

julx


People also ask

How to get out of PyDev Eclipse?

pydev* from eclipse/plugins and eclipse/features or you can go to help > software updates > manage configuration, choose the PyDev plugin and disable it (after that, to completely remove it, you must restart Eclipse and only then select it for uninstall).

How do I run PyDev?

Go to the menu: Alt + R + S + The number of the Run you wish (It can be Python, Jython, unit-test, etc). Note: if you were using unit-tests, you could use: Ctrl+F9 to run the unit-tests from the module (and even selecting which tests should be run -- and if Shift is pressed it's launched in debug mode).

How to import PyDev in Eclipse?

After opening Eclipse, go to the menu: File > New > Project > PyDev > PyDev project. You should see the screen below: Project name: The name of the project.


1 Answers

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.

like image 195
Bae Avatar answered Nov 10 '22 13:11

Bae