简体   繁体   English

如何在Python 3.4中使用pip安装Pygame?

[英]How do I install Pygame with pip in Python 3.4?

I have tried commands like 我试过像这样的命令

pip install pygame

or 要么

pip install 'Pygame == 1.9.1release' --allow-external Pygame --allow-    unverified Pygame

suggested in other threads but and similars but they don't seem to work for me. 建议在其他线程,但和类似,但它们似乎不适合我。 Help me, please. 请帮帮我。

I did this in Ubuntu and it worked for me with Python 3.4: 我在Ubuntu中做到了这一点,它适用于Python 3.4:

I ran a command which apparently upgraded pip and setuptools to the latest version, according to this guide in the docs , but did it as a superuser. 根据文档中的这个指南,我运行了一个显然将pipsetuptools升级到最新版本的命令,但它是以超级用户身份执行的。 It might end up not being strictly necessary: 它最终可能不是绝对必要的:

sudo pip install -U pip setuptools

Then, I ran the install command for Pygame as a superuser as well: 然后,我也以超级用户身份运行Pygame的install命令:

sudo pip install pygame

In Windows 在Windows中

1.open CMD 1.开放CMD

2.Path should locate where pip is installed for me it is C:\\Users\\qwrht\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts> 2.Path应该找到为我安装pip的地方它是C:\\ Users \\ qwrht \\ AppData \\ Local \\ Programs \\ Python \\ Python36-32 \\ Scripts>

if python is in other directory follow steps in link CMD command to change directories 如果python在其他目录中,请按照链接CMD命令中的步骤更改目录

3.getting to the right path where pip is installed use command **pip install pygame.**in CMD 3.在安装pip的正确路径中使用命令** pip install pygame。**在CMD中

4.after Downloading pygame current version, Successfully installed pygame message will be displayed 4.下载pygame当前版本后,将显示成功安装的pygame消息 如图所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM