installing 2.4

J

Jive

I just now installed 2.4. I naively copied my site-package from 2.3. The
first program I tried to run, which uses the gnuplot package, got this
error, complaining about module Numeric:

ImportError: Module use of python23.dll conflicts with this version of
Python.

Grumble: Why does Numeric reference a module by release number?

My real question is, what all do I have to do in order to get the programs I
ran under 2.3 to work with 2.4?
 
J

Jive

Correction. It still runs under 2.3. However, Pythonwin now doesn't work
right under 2.3. The interactive window grabs the cursor and won't let it
go. I have to go to the task manager to kill Pythonwin.
 
P

Peter Hansen

Jive said:
I just now installed 2.4. I naively copied my site-package from 2.3. The
first program I tried to run, which uses the gnuplot package, got this
error, complaining about module Numeric:

ImportError: Module use of python23.dll conflicts with this version of
Python.

Grumble: Why does Numeric reference a module by release number?

My real question is, what all do I have to do in order to get the programs I
ran under 2.3 to work with 2.4?

Install all new versions (compatible with 2.4) of any *extension
modules* that you are using, such as Numeric. Only pure Python
code can run without change on a newer interpreter. Anything
that has a .pyd or .so file (i.e. dynamic libraries, containing
C code that follows the Python extension API conventions) must
be recompiled for the new version.

-Peter
 
J

Jive

Well ain't that a kick in the pants?

Version 2.3 is broke now, so I'm kind of stuck. I haven't found a 2.4
version of Numeric. Do you know where to find one?
 
J

Jeff Shannon

Jive said:
Well ain't that a kick in the pants?

Version 2.3 is broke now, so I'm kind of stuck. I haven't found a 2.4
version of Numeric. Do you know where to find one?

Since 2.4 has only been released for a few days, it'll probably be a
short while yet before all the various third-party package maintainers
get a chance to build 2.4 versions of their packages. Your main options
at this point are to wait, or to do compile it yourself from source, or
to convince/bribe someone else to compile it from source for you. I
expect that a major package like Numeric will have 2.4-compiled binary
distributions pretty soon.

As for 2.3 being broken, check your application path and file
associations. You may be inadvertently running the 2.3 version of
Pythonwin under the 2.4 interpreter.

Jeff Shannon
Technician/Programmer
Credit International
 
J

Jive

I am befuddled. I've re-installed everything I can think of, but I still
get this behavior: I start up Pythonwin. Sometimes the interactive window
shows the copyright stuff; sometimes it doesn't; In any case, I can't close
it by clicking on the X button at the top right of the main window. The
interactive window seems to have the focus monopolized. I have to go to the
task manager to kill it.

As for checking the "application path", I don't know what that means.

I am rather disappointed with this turn of events.
 
J

Jive

It's only getting worse. I went to Add/remove programs and removed 2.4.
Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as
installed, but I cannot remove them.
 
J

Jeff Shannon

Jive said:
As for checking the "application path", I don't know what that means.

Go to a command prompt, and type 'echo %path%'. You'll see a list of
all the directories that Windows looks in to find an executable -- i.e.,
if you type 'python', Windows will work through this list of directories
looking for a program named 'python', and will execute the first one it
finds. If you want 2.3 to be your default Python version, then you
should have 'C:\Python23\.' somewhere near the front of this list. If
'C:\Python24\.' is first in the list, then you may be running the wrong
version of Python.

Now, start up Windows Explorer and from the Tools menu, select 'Folder
Options'. In the property sheet that comes up, go to the 'File Types'
tab. Scroll down until you find the entry for 'PY Python File', select
it, and click on the 'Advanced' button near the bottom. You're now
looking at the file associations for .py files. Select the 'open'
action, and click 'Edit...'. If the application listed specifies a
Python24 path, then all .py files will (by default) be run by Python24.
If there's no path specified to python.exe, then Windows will search the
application path (as described above), and you might or might not be
running 2.4 by default.

I would *think* that uninstalling 2.4 should return these to their
previous values (i.e. 2.3), but I'm not sure. If they're not valid
values, then we can try to walk you through fixing them. (Note that I'm
giving directions that match Windows 2000, since that's what I'm on
right now. Things maybe a bit different if you're using a different
version of Windows, so be sure to include your Windows version in any
replies...)

Also, I'm presuming that the 2.4 packages that you installed use
distutils, which of course requires Python to be present. Ideally, you
should uninstall those packages *before* you uninstall Python 2.4. You
can try reinstalling 2.4, uninstalling the packages, and then
uninstalling 2.4 again... or, if the packages' files were deleted when
Python was uninstalled, you may have to hack your registry to remove
those entries from the uninstall list.

Jeff Shannon
Technician/Programmer
Credit International
 
D

David Bolen

Jive said:
It's only getting worse. I went to Add/remove programs and removed 2.4.
Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as
installed, but I cannot remove them.

You mentioned in your first post about "copying your site package"
.... did you actually make a copy or did you perhaps "move" your
site-packages directory from beneath 2.3 to under 2.4. If so, then
the uninstall entry in the registry is not going to find the files to
be able to uninstall them.

Worst case you should be able to reinstall Python 2.3, and your
extension packages from their installer images. Don't worry about the
uninstall list in Add/Remove programs as reinstalling the packages
will just update their entries. That will refresh the files in your
Python 2.3 tree, and providing you don't disable the option, should
re-establish file associations and what not back to a 2.3
installation.

-- David
 
J

Jive

Jeff Shannon said:
Go to a command prompt, and type 'echo %path%'. You'll see a list of
all the directories that Windows looks in to find an executable -- i.e.,
if you type 'python', Windows will work through this list of directories
looking for a program named 'python', and will execute the first one it
finds. If you want 2.3 to be your default Python version, then you
should have 'C:\Python23\.' somewhere near the front of this list. If
'C:\Python24\.' is first in the list, then you may be running the wrong
version of Python.

It now has Python22 in the path! How do I change that? I just now
re-installed 2.3 BTW.
 
J

Jive

David Bolen said:
You mentioned in your first post about "copying your site package"
... did you actually make a copy or did you perhaps "move" your
site-packages directory from beneath 2.3 to under 2.4. If so, then
the uninstall entry in the registry is not going to find the files to
be able to uninstall them.

I copied, not moved;
Worst case you should be able to reinstall Python 2.3, and your
extension packages from their installer images. Don't worry about the
uninstall list in Add/Remove programs as reinstalling the packages
will just update their entries. That will refresh the files in your
Python 2.3 tree, and providing you don't disable the option, should
re-establish file associations and what not back to a 2.3
installation.

I've re-installed it, but things are all screwed up still.
 
M

Matt Gerrans

Peter Hansen said:
Only pure Python code can run without change on a newer interpreter.

Is the interpreter smart enough to rebuild a pyc (if the corresponding py
file is there of course) file that was built by a previous version?
 
P

Peter Hansen

Matt said:
Is the interpreter smart enough to rebuild a pyc (if the corresponding py
file is there of course) file that was built by a previous version?

Yes. The .pyc files contain a magic cookie that is
different in each major version, so 2.4 will recompile
your 2.3 .pyc files. .pyc files are not portable
between versions, generally, excepting maintenance releases.

-Peter
 
S

Steve Holden

Peter said:
Yes. The .pyc files contain a magic cookie that is
different in each major version, so 2.4 will recompile
your 2.3 .pyc files. .pyc files are not portable
between versions, generally, excepting maintenance releases.

-Peter

In fact this hidden recompilation, when it has to be applied to large
libraries, can impact performance considerably. I first came across this
when testing an application (which had its own, quite significant,
libraries) for compatibility between Cygwin and the standard Windows
interpreter, across different version numbers.

It was only when I started to look at file creation times I twigged that
running the program (for the first time only) under a different regime
was causing the libraries to be recompiled. Then the reason for the
inconsistency in run times was then obvious.

regards
Steve
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top