How do I install Python pygame? Detailed tutorial Example of Python pygame installation

Source: Internet
Author: User
This article mainly describes the detailed Python pygame installation process notes. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.

See a tutorial today about Python Installing the Pygame module. Feel good, share it.

Install Python

Well, this little problem seems to be superfluous here. But in order to take care of the children's shoes just learning python, I still have to say a few words.

specific as follows:

We're going to the Python website. To download the version we need. I am downloading the windows64 bit of the Python2.7 MSI here. If the installation process is not understood, select the default.

Installing Easy_install

What is this? We don't have to worry about it, but now we just need to know it can help us install some libraries. The installation process is also simple, just download the library and use the Python command to install it.

Install PIP

Well, after the first two steps, presumably everyone (especially the newly-introduced children's shoes) will certainly be very upset, how to install so many things. But don't lose heart, because the good day is coming soon. Pip is an artifact that frees up the complex work of your installation library. Let's take a look at how to install PIP.

Before you do this, make sure that Python and Easy_install are already installed on your Windows system.

Flag for Successful Installation:


Microsoft Windows [version 6.1.7600] Copyright (c) Microsoft Corporation. All rights reserved. C:\users\administrator>pythonpython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5, 20:40:30) [MSC v.1500-bit (AMD64)] on Win32type "Help", "copyright", "credits" or "license" for more information.>>> exit () C:\Users\Administrator >easy_install-versionusage:easy_install [options] Requirement_or_url  ... Or:easy_install--helperror:option-r not recognizedc:\users\administrator>

The next step is to switch the directory to the script folder under the Python installation directory and enter
Easy_install PIP. Of course, if you want to be more convenient, you can configure this path to your environment variables (as for how to match, the online tutorials are very detailed.) I will not make the wheel again.)

Verify that:


C:\USERS\ADMINISTRATOR&GT;PIP-VUSAGE:PIP <command> [options]commands:install install packages. Download Download packages. Uninstall Uninstall packages. Freeze Output installed packages in requirements format. List List installed packages. Show show information about installed packages. Search Search PyPI for packages. Wheel Build wheels from your requirements. Hash Compute hashes of the package archives. Completion A helper command used for command completion help Show help for commands. General Options:-H,--help Show help. --isolated Run pip in an isolated mode, ignoring environment variables and user Configuration. -V,--verbose Give more output. Option is additive, and can are used up to 3 times. -V,--version Show version and exit. -Q,--quiet Give less output. --log <path> Path to a VerboSe appending log. --proxy <proxy> Specify a proxy in the form [User:passwd@]proxy.server:port. --retries <retries> Maximum Number of retries each connection should attempt (default 5 times). --timeout <sec> Set The socket timeout (default seconds). --exists-action <action> Default Action when a path already exists: (s) witch, (i) Gnore, (W) Ipe, (b) AC Kup.  --trusted-host 

Installing Pygame

The premise of installing pygame that must be the first to download this file AH. So we need to download a bit. Pygame file download. Remember to download the Python version that corresponds to you.

After the download we will find that it is a. WHL suffix file. This is more embarrassing. How do you open it?

The answer is to use another tool, wheel. Wheel is essentially a ZIP package format that uses the. WHL extension for the installation of the Python module, which appears to replace the Eggs. Wheel also provides an extended command Bdist_wheel as Setuptools, which can be used to generate a wheel package. Wheel, check if the installation is successful.

The way to install wheel is much more fun this time. Because we already have the PIP.

pip install wheel。 It's done.

Now go back to the PYGAMEXXXXX.WHL directory, wheel file name. All right, it's done.

Verify


C:\users\administrator>pythonpython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5, 20:40:30) [MSC v.1500-bit (AMD64)] on Win32type "Help", "copyright", "credits" or "license" for more information.>>> import pygame>>>

The wooden error, which means that we have successfully installed. Let's start with a pleasant Pygame tour.

Summarize

The overall installation process is a very tangled one. Especially for children who have just started their shoes. However, this is also the most valuable experience. Because the installation of these libraries will make you more familiar with the architecture of Python. The overall structure of the grasp will be more good.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.