Upgrading Python from 2.4 to 2.6 - can I just copy site-packages folder?

548 views
Skip to first unread message

Nick

unread,
Jun 8, 2010, 5:25:49 AM6/8/10
to Django users
Hi,

I'm currently running Django on CentOS using the supplied Python 2.4.
I now need to use Python 2.6. I have installed Python 2.6 from the
EPEL repositories, which sits alongside 2.4 (which is required for
CentOS things such as "yum").

Django (and other Python modules) are all located in Python 2.4's site-
packages folder. When I upgrade to 2.6, is it just a case of copying
these over into 2.6's site-packages folder, or do I need to install
the modules afresh?

Thanks,
Nick

backdoc

unread,
Jun 8, 2010, 9:05:01 AM6/8/10
to django...@googlegroups.com
I haven't tried it. But, I wouldn't think so. It shouldn't be hard
to install Django for 2.6. I've never used CentOS. But, most of the
time, a version requirement means "at least". Of course, in the case
of Python 3, that would not be true.

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

Alex Robbins

unread,
Jun 8, 2010, 10:32:27 AM6/8/10
to Django users
You don't want to just copy site-packages. If you have any compiled
modules (pyyaml, PIL, etc) they won't work, since they were compiled
for the old version of python.

Alex

Bill Freeman

unread,
Jun 8, 2010, 10:50:39 AM6/8/10
to django...@googlegroups.com
Additionally, the .pyc files are version specific. IF you had no specific
incompatibilities, you could consider deleting all .pyc files in the copy,
then import every .py file running as root, to make new .pyc files.

But then there are likely to be plenty of other issues anyway, as Alex
points out.

This is all much more work than just installing stuff fresh, in these bold
new days of distribute and pip install.

Bill

Alex Robbins

unread,
Jun 8, 2010, 11:14:27 AM6/8/10
to django...@googlegroups.com
you could do a pip freeze in your old install, then do a pip install
-r requirements in the new one. That would probably catch most things.

Alex

Nick

unread,
Jun 14, 2010, 4:23:08 AM6/14/10
to Django users
Many thanks for your helpful posts - in the end I just changed a bit
of my code to work with 2.4, but this will come in handy for when I
finally make the upgrade.

Thanks again,
Nick
Reply all
Reply to author
Forward
0 new messages