python - PyGame not working in Eclipse using Python3.4 -


i using linux mint 17 (ubuntu 14.04) , got pygame 1.9.2 working in eclipse on windows pc. installed on machine, doesn't work. there no apt-get python3-pygame downloaded source https://bitbucket.org/pygame/pygame , built , installed without getting errors.

when running following on command line receive no error:

import pygame pygame.init() 

if try same in eclipse pydev project error: "undefined variable import: init".

first thought interpreter not set correctly, path pygame installed added libraries (/usr/local/lib/python3.4/dist-packages). realized python2.7 pygame installed in /usr/lib/pytho2.7/dist-packages instead, directory doesn't exist python3.4 on machine.

since seems work on command-line must have eclipse or pydev settings, right?

update: ok, things getting confusing. found out pygame indeed working within eclipse if run project, giving me these error messages eg. pygame.init(), pygame.quit, pygame.k_escape, pygame.keydown. find strange, because pygame.time.clock() or pygame.display.set_caption() don't give error messages. undefined variable import errors (also see here how fix pydev "undefined variable import" errors? ).

use sudo pip3 install pygame, pip3 should work assuming have python3 , setuptools installed.
can install pip3 using sudo apt-get install python3-pip , use sudo pip3 install package_name whatever want.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -