简体   繁体   English

如何在 Debian jessie 上为 Python 3 安装 pygame?

[英]How can I install pygame for Python 3 on Debian jessie?

I tried many times to install pygame for Python 3.5, but never succeeded.我多次尝试为 Python 3.5 安装 pygame,但从未成功。 For example, I tried this but got the following error:例如,我尝试了操作,但出现以下错误:

$ python3
>>> import pygame
enter code hTraceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pygame'
>>>

Everything looks fine while building and installing, but I still don't see any changes.构建和安装时一切看起来都很好,但我仍然看不到任何变化。 Did I forgot something?我忘了什么吗? Is there something wrong?有什么不对?

Just do:做就是了:

$ sudo pip3 install pygame

The problem was that, at the time, pygame wasn't packaged yet.问题是,当时 pygame 还没有打包。 This is no longer an issue.这不再是一个问题。

I had the same problem on debian 8 and I upgraded pip:我在 debian 8 上遇到了同样的问题,我升级了 pip:

sudo python3 -m pip install --upgrade pip

I have installed pygame using the code from Pygame website :我已经使用Pygame 网站上的代码安装了 pygame:

python3 -m pip install pygame --user

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

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