Aptana vs. Eclipse - pygame working only on Aptana?
Have used Eclipse with PyDev for a while...without any problems. Recently I wanted to try out PyGame but the problem is that Eclipse gives errors when trying to do that:
Traceback (most recent call last): File "C:\Users\Artur\workspace\miniprojekt\src\pygame.py", line 1, in <module> import pygame File "C:\Users\Artur\workspace\miniprojekt\src\pygame.py", line 2, in <module> from pygame.locals import * ImportError: No module named locals
Then after trying to find a solution for a few hours without luck... decided to try some other IDE programs and finally found Aptana Studio which is based on Eclipse if I'm not wrong. Aptana uses the same PyDev add-on but the difference is that the code works there without problems.
Then I decided to try Aptana plugin for eclipse, thinking that maybe it would make a differece. And again I get the same error as before.
The code works in Python IDLE and in Aptana Studio 3 with PyDev...
The code doesn't work on Eclipse SDK 3.7.1 with PyDev...
And now I'm having trouble understanding why PyGame works in Aptana and not in Eclipse, as they both apparently use PyDev? Also all solutions for using PyGame in Eclipse are welcome...
(I'm using Python 3.2)
You are right in that Aptana Studio 3 uses the same PyDev you installed, so, it should be exactly the same thing... do the following:
Update PyDev to the latest nightly build -- this is just to be sure you have the proper version.
Rename your own module from pygame.py to something else... i.e.: mypygame.py (this should fix your problem, as what's probably happening is that when it's looking for pygame it's finding your version and not the pygame you really wanted).
Note: just to be in the safe side, you may want to clear all your .pyc files too (right click folder > pydev > remove *.pyc)