Upgrading to 2.3 from 2.2, questions

Peter Hansen peter at engcorp.com
Mon Aug 30 20:17:30 EDT 2004


Jeff Shannon wrote:

> Peter Hansen wrote:
>> Robert Oschler wrote:
>>> - Do I need to uninstall 2.2 first?
>> I don't know if there's an official answer other than "yes".  I don't
>> know if there's a safe answer other than "yes".
> 
> I'm pretty sure that there should be no problems with having different 
> versions of Python running side-by-side.  I have had 2.0 and 2.1 on the 
> same machine, and 2.1 and 2.2, with no problems at all.

Robert is quite right that multiple versions can work together
simultaneously.  In fact, some of us have to do development
which ensures compatibility with different versions by running
automated tests under each of several installed copies of Python.

(I took the OP's subject line "upgrading" to imply this wasn't
what he wanted to do, but it is certainly feasible and simple.)

> however, if you copy from site-packages to site-packages, be sure to 
> delete any .pyc files because those are probably *not* 
> version-portable.  

(If the .py files still exist, they will quietly be recompiled to
.pyc files by the new version, so this shouldn't normally be
a concern.  If a given .py file is gone and only the .pyc file
exists, I believe you should get a "RuntimeError - Bad Magic
number in .pyc" message.  As I mentioned above, we often
alternate between versions of Python and rarely have to pay
special attention to the .pyc files that are left in our
application directories, and site-packages should be no
different.)

-Peter



More information about the Python-list mailing list