title: Pydev "Undefine variable from import" using pygame on Ubunutu but not Windows
body: <h2>In a nutshell</h2>
  
  <p>On Ubuntu 11.10, for the pygame library, pydev reports "undefined variables from imports". On Windows 7, everything is fine. On both platforms, the code works properly.</p>
  
  <p>This is the same error as <a href="https://stackoverflow.com/questions/2112715/how-do-i-fix-pydev-undefined-variable-from-import-errors">this thread</a> (and a <a href="https://stackoverflow.com/questions/2143549/undefined-variable-from-import-when-using-wxpython-in-pydev">bunch</a> <a href="https://stackoverflow.com/questions/7966621/pydev-import-in-eclipse">of</a> <a href="https://stackoverflow.com/questions/4521258/pydev-undefined-variable-from-import-error">others</a>). Removing and re-adding my interpreter did not change anything. I also tried to include pygame as a forced built-in lib, but it did not change anything (I checked that pygame was in system PYTHONPATH).</p>
  
  <h2>Configs</h2>
  
  <p>On both Ubuntu and Windows, I'm using Eclipse Indigo and Python 3.2.</p>
  
  <p>On Ubuntu, I'm using:</p>
  
  <ul><li>Ubuntu 11.10
  </li><li>Pygame 1.9.2pre compiled from the pygame Hg repo. When built and installed, the site-packages/pygame folder contains a bunch of .so and .py files. 
  </li></ul>
  
  <p>On Windows7:</p>
  
  <ul><li>Windows 7 pro with SP1
  </li><li>Pygame 1.9.2pre from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame" rel="nofollow noreferrer">lfd.uci.edu</a>. The MSI created a bunch of .pyd and .py to the site-packages/pygame folder. 
  </li></ul>
  
  <p>I understand that static analysis can't go inside .so files on Ubuntu. I also understand that Python is a dynamic language. Hence pydev has limitations inherent to static analysis. But pydev on Windows 7 manages to link the classes inside .pyd files, which are dynamic libs. Why? And how could I make it work on Ubuntu?</p>
  
  <h2>Hints?</h2>
  
  <pre><code>import pygame
  from pygame.locals import *
  </code></pre>
  
  <p>With the above code in Ubuntu, I can ctrl-click (or f3) to the pygame package, but not to the pygame.locals. On Windows I can go to both.</p>
  
  <pre><code>import pygame
  import pygame.locals
  from pygame.locals import *
  </code></pre>
  
  <p>Now I can go to pygame.locals. I guess that helped pydev to figure out what to "expect", since locals.py actually exists in the site-packages/pygame folder. But I don't want to change all my code just to suit pydev. </p>
  
  <p>Anyway, the line below still raises "undefined variable from import" on Ubuntu, but not on Windows.</p>
  
  <pre><code>except pygame.error:
  </code></pre>
  
  <p>PS: In case that helps, I have a 64 bit Lenovo T410, and installed everything for 64 bits.</p>