Search code examples
pythonimportmodulepydevpyglet

Import pyglet on python


I have downloaded the pyglet.dmg file from pyglet website and simply installed it.

The folder on which it is saved is: /Developer/pyglet

And on the pydev editor i simply state the location i want to use by:

import sys
sys.path.append('Developer/pyglet')
import pyglet

music = pyglet.resource.media('music.mp3')
music.play()

pyglet.app.run()

But for some reason i cant get this import:

python sound.py 
Traceback (most recent call last):
File "sound.py", line 3, in <module>
import pyglet
ImportError: No module named pyglet

Any idea on how to make it work?


Solution

  • Ok got it.

    I just downloaded the source files and compiled it by myself by invoking:

    sudo python setup.py install
    

    And then simply used the sys import as described in the question.