简体   繁体   English

“ ImportError:没有名为pygame.base的模块”-Pypy3和pygame

[英]“ImportError: No module named pygame.base” - Pypy3 and pygame

After several trials for install pygame in pypy3, I did it with the bitbucket version, cloning with mercurial and installing this way: 经过几次在pypy3中安装pygame的尝试后,我使用bitbucket版本进行了此操作,并使用mercurial进行了克隆并以这种方式安装:

"pypypath"/bin/pypy3 setup.py

However, when I'll make the import, the following error appears: 但是,当我进行导入时,会出现以下错误:

Traceback (most recent call last):
  File "/home/rafael/PycharmProjects/pygame-teste/__init__.py", line 3, in <module>
    import pygame
  File "/opt/pypy3-2.4.0-linux64/site-packages/pygame/__init__.py", line 133, in <module>
    from pygame.base import *
ImportError: No module named pygame.base

This error also happened in python3 with Debian Wheezy, but worked when I was using pycharm. 使用Debian Wheezy在python3中也发生了此错误,但是在我使用pycharm时有效。

Now, I'm using Debian Jessie and it imports pygame successfully in python3 from prompt, but pypy has this error now. 现在,我正在使用Debian Jessie,它从提示符处成功在python3中导入pygame,但是pypy现在出现此错误。 (And don't import in pycharm too). (也不要导入pycharm)。

Any idea? 任何想法?

pygame does not work on pypy. pygame在pypy上不起作用。 You can try pygame-cffi, but I'm not sure it's python 3 compatible. 您可以尝试pygame-cffi,但我不确定它是否与python 3兼容。 You might also need to improve places, since it's unfinished, but generally works. 您可能还需要改善位置,因为它尚未完成,但通常可以正常工作。

Pygame 1.9.2 supports Python 3.2 and up. Pygame 1.9.2支持Python 3.2及更高版本。 Only the orphaned _movie module (not built by default) does not. 只有孤立的_movie模块(默认情况下未构建)没有。

Python 3 can support Pygame; Python 3可以支持Pygame; ANOTHER ANSWER IS NEEDED! 需要另一个答案!

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

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