1

I'm trying to use pypy compiler to run my python code but the sys.path for pypy is different from normal python compiler so when I tried to import default modules such as

import pygame

it fails in pypy, stating that the module is not found, while it works correctly with the normal python command. Any help is greatly appreciated.

4

1 に答える 1

3

CPython 用にインストールされたモジュールは、すぐに PyPy で動作することを期待していると思います。そうではありません。CPython 2.6 から CPython 2.7 にアップグレードする場合も同じです: 2.6 用に既にインストールしたモジュールは 2.7 用に自動的に使用可能になるわけではないため、再インストールする必要があります。同様に、PyPy のモジュールを再インストールする必要があります。

つまり、標準の pygame は PyPy ではうまく機能しませんが、しばらくお待ちください。誰かが cffi に基づいた pygame のバージョンに取り組んでいるようです。これは PyPy で非常にうまく動作するはずです。

于 2013-06-19T12:19:32.887 に答える