Skip to content Skip to sidebar Skip to footer

How To Get Pyglet Working For Python 3?

I am excited to use Pyglet because of all its features, however I am having problems installing the latest development build of Pyglet on Python 3. I am aware people have already a

Solution 1:

Install using the below command:

pip3 install pyglet

This worked for me.

Solution 2:

Instead of installing pyglet you can also put a copy of pyglet in the project folder and import it from there. This approach makes it also easy to use different versions of pyglet for your projects.

To make pyglet running on python 3 you need to convert the latest version of pyglet using 2to3. Without that conversion it will not run on python 3. With previous versions of pyglet you will have difficulties when trying to convert it so make sure to use 1.2 (which is currently at alpha state but quite stable).

Solution 3:

I used:

    pip3 install pyglet

and it works perfectly. Make sure that when you run python from the terminal you use

    python3

and not

    python

because that messed it up for me at first.

Solution 4:

The solution is to pip install from the rep, e.g. using

pip install -e hg+https://pyglet.googlecode.com/hg/@2813:0aa8bfe3313a#egg=pyglet

this is because the current version of pyglet in pip is not compatible with python 3 yet.

Solution 5:

I applied the answer of @J. C. Leitão to Ubuntu 14.04.

sudo apt-get install python3-git mercurial
sudo pip3 install -e hg+https://pyglet.googlecode.com/hg/@2813:0aa8bfe3313a#egg=pyglet

And now I can import pyglet.

(However it seems to not work properly. If I run the hello world program the Hello world can not bee seen in the window. I can see just darkness in it.)

Post a Comment for "How To Get Pyglet Working For Python 3?"