Different sys.path between pypy and normal python

I am trying to use the pypy compiler to run my Python code, but the sys.path for pypy is different from the regular python compiler, so when I tried to import default modules, such as

 import pygame 

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

+1
source share
1 answer

I think you expect that any module installed for CPython will work with PyPy out of the box. This is not true. The same thing happens when upgrading from CPython 2.6 to CPython 2.7: the modules that you already installed for 2.6 are not automatically available for version 2.7 and must be reinstalled. Similarly, you must reinstall the modules for PyPy.

This suggests that the standard pygame does not work too well with PyPy, but stay tuned; it looks like someone is working on a cffi based pygame version that should work well with PyPy.

+3
source

Source: https://habr.com/ru/post/947981/


All Articles