Installing Pyglet on Python 3 (For MS Windows)

This post is a guideline on ‘How to install Pyglet on python 3.

Pyglet is used for object-oriented programming for developing high-graphic applications and games that can be executed in multiple operating systems including Microsoft windows and Mac OS. It is basically a library which can be imported into any python file to develop GUI based applications.

Pyglet can be installed in number of ways. One of the easiest is to use ‘pip’.It is a python instillation package which is used to install other packages. The good thing  is that, pip is already installed in python. Following is the step by step procedure for installing pyglet.

Step 1:

Write ‘cmd’ in search bar in windows start menu. Open the command prompt on your PC. Type the following command and press enter:

pip install pyglet

pyglet step 1.PNG

This step might directly work for some users. If so, you will see the downloading and installation process of pyglet on screen. And you are ready to develop GUI based applications.

But for many, cmd will display an error stating ‘pip is not recognized as an internal or external command’.

pyglet step 12.PNG

This does not mean that pip is not installed on your PC. Instead it tells us that the pip installation package is not present in the current working directory. Therefore we now need to change our directory. Now follow Step 2.

Step 2:

Search for IDLE in search bar (in start menu). Right click on it, you will see a drop down menu. Select ‘Open file location’

pyglet step 2.PNG

Step 3:

Right click on IDLE, select properties from the drop down menu. You will see a window on the screen. Copy the path written next to the title ‘Target’.Ignore the part of the path after Python35-32\. It should be somewhat similar to that of mine which is as follows:

C:\Users\HP\AppData\Local\Programs\Python\Python35-32\pythonw.exe “C:\Users\HP\AppData\Local\Programs\Python\Python35-32\pyglet step 3.PNG

Step 4:

Open command prompt, type ‘cd’ and paste the path copied in previous step and add Scripts\ to the path

cd C:\Users\HP\AppData\Local\Programs\Python\Python35-32\Scripts\

This command will change your directory to Scripts. Now we can use pip to install pyglet. To do this type the following command:

pip install pyglet

Pyglet will be downloaded and installed automatically on your machine.

pyglet step 5.PNG



2 Comments Add yours

  1. Waqar Saleem says:

    Good idea to document this!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s