首页 > 编程 > Python > 正文

详解Python pygame安装过程笔记

2020-02-16 01:38:48
字体:
来源:转载
供稿:网友

今天看到一个教程,是关于Python安装pygame模块的。觉得很好,拿来分享一下。

安装Python

额,这个小题貌似在这里很是多余啊。但是为了照顾到刚刚学习Python的童鞋,我还是多啰嗦两句吧。

具体如下:

我们要到Python官网。去下载我们需要的版本。我这里下载的是windows64位 的Python2.7 msi。安装的过程如果不懂,选择为默认即可。

安装easy_install

至于这是个什么东东?我们大可不必劳心,现在只需要知道它能帮助我们安装一些库就可以了。具体的安装过程也很简单,只需要下载这个库,使用python的命令进行安装即可。

安装pip

好了,经过了前面的两步,想必大家(尤其是刚入门的童鞋)肯定会很心烦了吧,怎么需要装这么多的东西。但是咧,千万不要灰心,因为好日子马上就要来了。pip就是这么一款能解放你安装库的复杂劳动的一款神器。下面就一起来看一看怎么安装pip吧。

在此之前,一定要确认你的windows系统中已经安装好了Python和easy_install。

安装成功的标志:

Microsoft Windows [版本 6.1.7600]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:/Users/Administrator>pythonPython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 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>

接下来就是把目录切换到python的安装目录下的Script文件夹下,输入
easy_install pip。当然了如果要想方便一些的话,可以把这个路径配置到你的环境变量中(至于怎么配,网上的相关教程很多也很详细。我就不重复的造轮子了)。

验证一下:

C:/Users/Administrator>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 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 be               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 15 seconds). --exists-action <action>  Default action when a path already exists:               (s)witch, (i)gnore, (w)ipe, (b)ackup. --trusted-host <hostname>  Mark this host as trusted, even though it does               not have valid or any HTTPS. --cert <path>        Path to alternate CA bundle. --client-cert <path>    Path to SSL client certificate, a single file               containing the private key and the certificate               in PEM format. --cache-dir <dir>      Store the cache data in <dir>. --no-cache-dir       Disable the cache. --disable-pip-version-check               Don't periodically check PyPI to determine               whether a new version of pip is available for               download. Implied with --no-index.C:/Users/Administrator>            
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表