[Python-Dev] User's complaints

Neal Norwitz nnorwitz at gmail.com
Fri Jul 14 05:02:13 CEST 2006


On 7/13/06, Jeroen Ruigrok van der Werven <ashemedai at gmail.com> wrote:
>
> > If it's pure python, why don't people just copy everything under
> > site-packages after installing?  They could/should run compileall
> > after that to recompile the .pyc files.  With 2.5 on 64-bit machines,
> > C extension modules *must* be recompiled due to lots of internal
> > changes.
>
> I wasn't even aware of the compileall step, can you elaborate since
> this is the first time I see it being mentioned.

python -mcompileall -h

It's in the stdlib.  It is used by the build process to recursively
traverse directories and compile all the .py files into .pyc (or .pyo)
files.  So if you wanted to copy everything from site-package in 2.4
to 2.5, you could do something like:

cp -r /usr/lib/python2.{4,5}/site-packages
/usr/bin/python2.5 -mcompileall -d /usr/lib/python2.5/site-packages

That should really be all that's required. It of course doesn't verify
the packages are correct or that you still want to keep all the files.
 This generally works for .so's too.  However a warning will be
generated each time you import the .so since it was built on an old
version of Python..  On 2.5 in 64-bit systems, this will definitely
not work.

> > One thing you didn't mention that I've heard from time to time is the
> > stdlib should be improved.  For example, cleaning up old modules.
> > Though I'm not really sure everyone has the same thing in mind when it
> > comes to improving the stdlib.
>
> How do you envision cleaning up old modules?

For me, manually.  Do you still need moduleX?  There's no way for a
computer to tell you the answer, it depends on what you will use with
the new version of Python.

n


More information about the Python-Dev mailing list