Python – How to import pygame libraries into Eclipse’s pydev

librariespydevpygamepython

I have Eclipse working and am working uder the Pydev plugin, and I need some help with pygame. I'm on a mac and have managed to get pygame working for python 3.3 using homebrew, and pydev's causing me some trouble. The libraries don't seem to be recognized. I can use pygame as needed, doing things like

import pygame

and

pygame.init()

without problem, but Eclipse doesn't recognize the modules and says things like

unresolved import: pygame

Again, I think the issue here is Eclipse not having access to the pygame libraries. How do I fix this?

Best Answer

Windows > Preferences > pydev

look for the python interpreter line

on the libraries tab, click new folder and add the pygame folder path, apply and you're done

NOTE : make sure to use python 3.x as the project interpreter