如何在Mac上将pygame成功安装到python3中?我尝试了很多语法来在python3中下载pygame.但是他们都没有工作 [英] How can I successfully install pygame into python3 on Mac? I tried a lot of syntaxes to download pygame in python3. But none of them worked

查看:69
本文介绍了如何在Mac上将pygame成功安装到python3中?我尝试了很多语法来在python3中下载pygame.但是他们都没有工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Mac上使用pip在python2中成功安装了pygame.但是我无法在python3中安装pygame.

I had successfully installed pygame in python2 using pip on Mac. But I was unable to install pygame in python3.

输入以下命令后:

$ brew install hg sol sdl_image sdl_ttf
$ brew install sdl_mixer portmidi
$ pip3 install --user hg_http://bitbucket.org/pygame/pygame

我得到了:

Failed building wheel for pygame
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
  Running setup.py install for pygame ... error

并且:

36 warnings and 8 errors generated.
    error: command 'clang' failed with exit status 1

我已确保安装了wheel和最新版本的setuptools.我使用命令再次尝试:

I had ensured that I installed wheel and the newest version of setuptools. I tried again using the command:

$ pip3 install pygame

我仍然得到:

Failed building wheel for pygame
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
  Running setup.py install for pygame ... error

我尝试过的其他语法:

$ pip3 install Pygame==1.9.3
$ python3 -m pip install pygame

但是所有这些都产生了相同的错误.

But all of them generated the same error.

那么,如何在python3中成功安装pygame?

So, how can I successfully install pygame in python3?

推荐答案

您需要使用pip只需输入

You need to use pip just enter

    python3 -m pip install pygame

这是一个有用的链接

http://medium.com/@louiscouture/tl-dr-pip-bcddaca44540 基本上,您对pip使用了错误的语法.

http://medium.com/@louiscouture/tl-dr-pip-bcddaca44540 You basically used the wrong syntax for pip.

这篇关于如何在Mac上将pygame成功安装到python3中?我尝试了很多语法来在python3中下载pygame.但是他们都没有工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆