Pygame: unresolved references and no autocomplete

I'm writing an application with Pygame but Pycharm doesn't seem to recognise a lot of Pygame when it comes to autocompletion and syntax checking.

For example, here's me using IPython to import a Pygame constant called K_ESCAPE from the pygame.locals module:

pygame1.png

Autocompletion works and then I import it. If I do the same thing in PyCharm, autocompletion doesn't find anything:

pygame2.png

I can manually type the full thing and the program works when it runs, but PyCharm marks it as an unresolved reference with a red line:

pygame3.png

Can anyone help me with this problem? All other modules work perfectly with PyCharm, it's only Pygame which seems to cause this issue. I really miss having the cool autocomplete and syntax checking I get with other modules. I'm running Python 2.7.6 on Arch Linux using PyCharm EAP 133.551. I had the same issue on the stable build of PyCharm as well.

I should note autocomplete does show some of the Pygame stuff, but there's lots missing. Another example is it doesn't autocomplete or resolve the Surface class from the pygame.surface module, it recognises the Sprite class from pygame.sprite without any issues though:

pygame4.png

Here's the surface class working inside IPython again:

pygame5.png
1 comment
Comment actions Permalink
I think the issue below might be why I'm having this problem:

http://youtrack.jetbrains.com/issue/PY-4057
0

Please sign in to leave a comment.