[Bf-python] Missing modules (?)

Willian Padovani Germano wgermano at ig.com.br
Sun Jun 6 04:42:24 CEST 2004


Hi,

Allow me to take this chance to explain the whole situation.

----- Original Message -----
From: "Manuel Bastioni" <manuelbastioni at tin.it>
To: <bf-python at blender.org>
Sent: Saturday, June 05, 2004 2:37 PM
Subject: Re: [Bf-python] Missing modules (?)

> Anyone can do a list of modules surely cross platfrom, that
> don't require full python configuration?

By default (meaning the Python files you can download from python.org for each
platform) the number of builtin modules is different, there are many more under
Windows:

(using Python 2.3.3, windows)
>>> import sys
>>> print sys.builtin_module_names
('__builtin__', '__main__', '_codecs', '_hotshot', '_locale', '_random',
'_weakref', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO', 'cmath',
'errno', 'exceptions', 'gc', 'imageop', 'imp', 'itertools', 'marshal', 'math',
'md5', 'msvcrt', 'nt', 'operator', 'pcre', 'regex', 'rgbimg', 'rotor', 'sha',
'signal', 'strop', 'struct', 'sys', 'thread', 'time', 'xreadlines', 'xxsubtype',
'zipimport')

Under linux the list is considerably smaller.  math, cmath and time, for
example, are shared .so files, not builtin there.  As far as I know, other
systems are like linux.

BUT

1) Ton once said that 80% of Blender downloads are for Windows.  In general,
these are also the users less eager to download Python.
2) *Python can be considered a default component of modern unix-based systems*
like Linux, Mac OS X, etc.  It comes with the distros and the only problem seems
to be that some users don't install all modules -- math and other modules are in
the "development" package in some (all?) distros, weirdly in my opinion.

So to define a list of modules we can count on, the main problem is windows.  We
can (I'd say we should) tell users of other systems that Python is a
requirement.  Then we can include or offer Windows users a package of selected
modules like:

chunk, colorsys, copy, copy_reg, gzip, ntpath, os, random, repr, stat, string,
StringIO, types, UserDict, whrandom and the zlib.pyd shared module.

These make two files: Python23.zip and zlib.pyd , a total of about 103KB only.
It includes important modules and others required by them.  And we can update
the list when necessary with more files.

Blender 2.33 Win should have come with these two files, but because of a problem
in communication it didn't.  It's still undecided if 2.34 will pack them or
offer as an extra download for Win.

(***) To know which modules can be considered cross-platform for Blender 2.34,
take the two lists above and don't take into account platform-specific ones like
msvcrt and nt / ntpath (use 'os'), of course.

Suggestions about other modules to include are welcome, just check if the module
you want requires itself other modules (that may require yet other modules) and
remember that the smaller we keep this zip, the better.  Some scripts will still
require full Python installs or at least extra modules provided by the script
author, specially if they need 3rd party extensions like wxpython, pil, etc.

Blender 2.34 should also have better support to tell users if they are missing
the modules they should have.  We can check on startup or on our import hook.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list