Upgrading to 2.3 from 2.2, questions

R

Robert Oschler

Hello,

(Note: if there is a FAQ that covers this issue just give me the URL. I
checked python.org's General and Windows FAQ's and didn't see anything.)

I am about to upgrade from Python 2.2 to 2.3. Here are a few questions:

- Do I need to uninstall 2.2 first?
- Are there any paths I should add to my Win 2k PATH environment variable?
- I am running on Windows 2000 and I have several site-packages installed.
These were installed using individual one-click installation programs (thank
you module writers). Do I need to rerun each of the installations again,
after I upgrade? Or, is there a directory or two I can simply copy over?
- Anything I should do before upgrading to preserve my current setup, or
other caveats?

Thanks.
 
P

Peter Hansen

Robert said:
(Note: if there is a FAQ that covers this issue just give me the URL. I
checked python.org's General and Windows FAQ's and didn't see anything.)

I think it's a frequently asked question, but it's not a FAQ...
I am about to upgrade from Python 2.2 to 2.3. Here are a few questions:

- 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".
- Are there any paths I should add to my Win 2k PATH environment variable?

Same as whatever you have with Python 2.2.... I try never to put
apps in my PATH, but use lots of .BAT files to run things and put
all those in a single \BIN folder that is in my PATH. Seems to
work out much cleaner that way.
- I am running on Windows 2000 and I have several site-packages installed.
These were installed using individual one-click installation programs (thank
you module writers). Do I need to rerun each of the installations again,
after I upgrade? Or, is there a directory or two I can simply copy over?

While it might work, it's not guaranteed. Extensions need to
be compiled for the specific version, while pure Python packages
will generally run as-is if you just copy them (generally they
are all in python/lib/site-packages). No guarantees again.
- Anything I should do before upgrading to preserve my current setup, or
other caveats?

Basically, nothing other than uninstall and full install of new
version plus all extensions is guaranteed to work, IMHO and IME.
On the other hand, I've often gotten by without uninstalling
and by copying or just leaving site-packages as-is, with the
exception of getting new versions of anything that has a .pyd
or .dll (C extensions).

-Peter
 
J

Jeff Shannon

Peter said:
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.
While it might work, it's not guaranteed. Extensions need to
be compiled for the specific version, while pure Python packages
will generally run as-is if you just copy them (generally they
are all in python/lib/site-packages). No guarantees again.


As Peter says, any packages that contain C extension (.pyd) modules need
to be compiled for the specific version of Python. You will need to
download new versions of those packages. Packages that are pure Python
*should* run just as well under the new version as the old version,
providing that it doesn't trip over any of the possible
backwards-compatibility issues (such problems are moderately unusual) --
however, if you copy from site-packages to site-packages, be sure to
delete any .pyc files because those are probably *not*
version-portable. You're probably better off re-running the installer,
if it's still available. (Also, odds are good that there's a new
version of those packages, and while you're upgrading Python is a good
time to upgrade other things too, so you may want to go ahead and
re-download those packages as well.)

Jeff Shannon
Technician/Programmer
Credit International
 
P

Peter Hansen

Jeff said:
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
 
M

Matthew K Jensen

Robert Oschler said:
Hello,

(Note: if there is a FAQ that covers this issue just give me the URL. I
checked python.org's General and Windows FAQ's and didn't see anything.)

I am about to upgrade from Python 2.2 to 2.3. Here are a few questions:

- Do I need to uninstall 2.2 first?
- Are there any paths I should add to my Win 2k PATH environment variable?
- I am running on Windows 2000 and I have several site-packages installed.
These were installed using individual one-click installation programs (thank
you module writers). Do I need to rerun each of the installations again,
after I upgrade? Or, is there a directory or two I can simply copy over?
- Anything I should do before upgrading to preserve my current setup, or
other caveats?

Thanks.

It's about time I try to give answers. Here I go...

1. No, and as a side note the GUI installer for windows gives you an
option to backup a lot of old python stuff in case you want to.
2. Did you have to with 2.2? I'm going to say no and stick with it
unless someone out there has something.
3. Not sure, but I'm leaning towards yes.
4. See #1 and back stuff up yourself too (just in case you need
another copy of things).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top