[Python-porting] six does not work with pypy3

Juha Nikkanen nikkej at gmail.com
Mon Mar 4 06:14:31 EST 2019


I'm running pypy3 on Fedora 29 and I found that modules depending on six
does not work. For example, I can't say:
Python 3.5.3 (7cafdf4fca72, Aug 27 2018, 22:02:53)
[PyPy 6.0.0 with GCC 8.2.1 20180801 (Red Hat 8.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import six
>>>> import six.moves as s
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'six.moves'

while in python 3.7.2 environment:
Python 3.7.2 (default, Jan 16 2019, 19:49:22)
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> import six.moves as s
>>> print( six )
<module 'six' from '/usr/lib/python3.7/site-packages/six.py'>
>>> print( s )
<module 'six.moves' (<six._SixMetaPathImporter object at 0x7f42865219e8>)>

I think this is because it seems import lib is frozen builtin on pypy3
installation on Fedora:
>>>> import sys
>>>> print( sys.builtin_module_names )
('__exceptions__', '__pypy__', '__pypy__._pypydatetime',
'__pypy__.builders', '__pypy__.intop', '__pypy__.os', '__pypy__.thread',
'__pypy__.time', '_ast', '_bz2', '_cffi_backend', '_codecs',
'_collections', '_continuation', '_crypt', '_csv', '_frozen_importlib',
'_imp', '_io', '_jitlog', '_locale', '_lsprof', '_md5', '_minimal_curses',
'_multibytecodec', '_multiprocessing', '_operator', '_pickle_support',
'_posixsubprocess', '_pypyjson', '_random', '_rawffi', '_rawffi.alt',
'_signal', '_socket', '_sre', '_string', '_struct', '_testing', '_thread',
'_vmprof', '_warnings', '_weakref', 'array', 'atexit', 'binascii',
'builtins', 'cmath', 'cpyext', 'errno', 'faulthandler', 'fcntl', 'gc',
'itertools', 'marshal', 'math', 'mmap', 'parser', 'posix', 'pwd',
'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'pypyjit', 'select',
'symbol', 'sys', 'termios', 'time', 'token', 'unicodedata', 'zipimport',
'zlib')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20190304/0cee647a/attachment.html>


More information about the Python-porting mailing list