473,473 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pylab Fails with Runtime Error on Win XP Under Python 2.4

I copied the following code from a matplotlib tutorial, and it fails. I'm
using python 2.4 on Win XP. It's matplotlib-0.98.3.win32-py2.4exe. It fails
in IDLE with a small window showing a runtime error. Clicking the OK on it
kills IDLE and the shell. If I double-click on the py file, the console
briefly appears too quickly to notice any contents. I have read raw to stop
it. If I execute it from a console window, I'm told the results will be
available there. I've long forgotten how to get a console window up in Win
XP. I can strip it all the code way down to the from, and it will fail the
same way. Bad matplotlib install? Python error?

Here's the code. I added finish() to it.

from pylab import *

def finish():
print; print "Bye"
print
raw_input('Press Enter to Quit')
sys.exit()

t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s, linewidth=1.0)

xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()
finish()

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 12 '08 #1
7 2351
Dennis Lee Bieber wrote:
On Sun, 12 Oct 2008 11:24:32 -0700, "W. eWatson"
<no*******@sbcglobal.netdeclaimed the following in comp.lang.python:

>available there. I've long forgotten how to get a console window up in Win
XP. I can strip it all the code way down to the from, and it will fail the
same way. Bad matplotlib install? Python error?
Well, in my case, I always put a copy of the XP "Command Prompt"
shortcut on the "start" menu, customized for my tastes (font
size/rows/columns). Lacking that, you should find it under:
start/programs/accessories/command prompt. You could also do start/run
and type "cmd".

As for IDLE (which I don't use) -- possibly some conflict between
its graphics system and that of matplotlib...

>Here's the code. I added finish() to it.

Runs okay on my system when started from PythonWin, but I'm likely
behind "current"

PythonWin 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)]
on win32.

ActivePython 2.4.3 Build 12 (ActiveState Software Inc.) based on
Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on
win32

*** Installation started 2007/03/15 21:31 ***
Source: C:\Documents and Settings\All
Users\Documents\matplotlib-0.90.0.win32-py2.4.exe

Let me archive my site-packages directory, and then locate a newer
matplotlib (hmmm, might need to get a newer numpy too){This is getting
nasty -- my numpy had been an egg, and the new installer is an .exe}

Okay -- matplotlib-0.98.3 and numpy-1.2.0 superpack installed...
Trying your code in a fresh PythonWin

Nope... That runs too (this time the left/right navigation arrows
displayed, but the pop-up help over the buttons wasn't).

And -- I just noticed, it IS using tk for plotting, and IDLE is also
tk; good place for conflicting event loops.
Thanks.

Oddly when I use cmd, it gets me to settings and docs. If I try c:\whatever
I get a msg, and it remains in the same folder.

I guess PythonWin is a download for another IDE than IDLE. Will modules be
available like mathplotlib if I install it, or do I have to establish them
for it? I'll look PythonWin once I get past the cmd operation.

Oct 12 '08 #2
Dennis Lee Bieber wrote:
On Sun, 12 Oct 2008 12:56:26 -0700, "W. eWatson"
<no*******@sbcglobal.netdeclaimed the following in comp.lang.python:

>Oddly when I use cmd, it gets me to settings and docs. If I try c:\whatever
I get a msg, and it remains in the same folder.

That's likely the defined "home directory" on your machine.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Dennis Lee Bieber>cd c:\bin

C:\bin>e:

E:\>cd "UserData\Dennis Lee Bieber\My Documents\Python Progs"

E:\UserData\Dennis Lee Bieber\My Documents\Python Progs>dir
Volume in drive E is Data
Volume Serial Number is 2626-D991

Directory of E:\UserData\Dennis Lee Bieber\My Documents\Python Progs

08/23/2008 01:26 PM <DIR .
08/23/2008 01:26 PM <DIR ..
08/23/2008 01:26 PM 1,089 azel_interp.py
04/22/2007 04:43 PM 1,622 binadd.py
04/22/2007 06:03 PM 1,485 binadd2.py
12/11/2006 10:21 PM 119,889 BookList.zip
<snipped>
06/13/2008 08:46 PM 1,929 timing.py
11/03/2007 10:31 PM 56 trips.dat
03/31/2006 11:31 PM 10 update_log
11/30/2005 10:11 AM 104 ut_00.py
112 File(s) 397,123,218 bytes
2 Dir(s) 270,550,671,360 bytes free

E:\UserData\Dennis Lee Bieber\My Documents\Python Progs>

NOTE: to change directory you need to enter the command:
cd new-directory
Without the "cd" your entry is being treated as the path to an
executable program -- and directories, of course, are not executable. To
change to a different partition/drive, you do enter just the drive
letter and a colon. And you need to do that separately -- each drive
maintains a "current directory"

E:\UserData\Dennis Lee Bieber\My Documents\Python Progs>cd c:\bin

E:\UserData\Dennis Lee Bieber\My Documents\Python Progs>dir
Volume in drive E is Data
Volume Serial Number is 2626-D991

Directory of E:\UserData\Dennis Lee Bieber\My Documents\Python Progs

<snipped>

E:\UserData\Dennis Lee Bieber\My Documents\Python Progs>c:

C:\bin>

Notice how changing drive to C: put me into the bin directory
specified earlier. If I now enter e:, I'll be back to the Python Progs
directory.
>I guess PythonWin is a download for another IDE than IDLE. Will modules be
available like mathplotlib if I install it, or do I have to establish them
for it? I'll look PythonWin once I get past the cmd operation.
It comes supplied with the ActiveState Python download (which also
includes the win32 extensions). I believe it can also be obtained as a
stand-alone with the win32 stuff.

The win32 extensions are:
http://sourceforge.net/project/platf...group_id=78018 (just
checked, PythonWin is included)
I worked my way into the folder where the py program is, but couldn't
executed. Just entering aprog.py, run aprog.py or exec aprog.py didn't work.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 12 '08 #3
Dennis Lee Bieber wrote:
On Sun, 12 Oct 2008 15:07:57 -0700, "W. eWatson"
<no*******@sbcglobal.netdeclaimed the following in comp.lang.python:

>I worked my way into the folder where the py program is, but couldn't
executed. Just entering aprog.py, run aprog.py or exec aprog.py didn't work.

Try:
python aprog.py

If that doesn't work, you'll need to check your environment variable
PATH to make sure the directory with the python interpreter is on it...
(I've added spaces and/or newlines after the ; to make for easier
reading)

Path=E:\Python24\; E:\GNAT\2008\bin; C:\WINDOWS\system32; C:\WINDOWS;
C:\WINDOWS\System32\Wbem; C:\Program Files\SciTE;
C:\Program Files\Java\jre1.6.0_03\bin;
C:\Program Files\Java\jdk1.6.0_03\bin;
C:\Program Files\Common Files\Adobe\AGL; C:\Tcl\bin;
C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;
C:\Program Files\Common Files\Roxio Shared\DLLShared\;
C:\PROGRA~1\MySQL\MySQL Server 5.0\bin;
C:\Program Files\TortoiseSVN\bin; E:\GNAT\GtkAda\bin; C:\MSSQL7\BINN;
c:\PROGRA~1\sdb\programs\bin; c:\PROGRA~1\sdb\programs\pgm; c:\Regina;
e:\Python24\Scripts

It IS possible to set an association so that *.py will invoke python
as the processor. Part of is the environment variable pathext...

PATHEXT=.COM;.EXE;.BAT;.pyw;.py;.pyo;.pyc;.CMD;.VB S;.VBE;.JS;.JSE;.WSF;.WSH;.tcl

But I think something else was required... Ah

FTYPE Python.File="E:\Python24\python.exe" "%1" %*

I entered at the H:\......\python_dev\ prompt
FTYPE Python.File="C:\Python24\python.exe" aprog.py
but nothing happened. Nothing at all in the console window other than it
still shows the folder path in the prompt. Well not quite. It just responded
with python.exe" aprog.py.

Is there some way to copy in and out of the console. A copy/paste seems to
get nowhere.

It's odd that I cannot widen the console window. It shows <---when I grab
a side.

Maybe I'll compile the code, as suggested by a poster above. I don't think
IDLE will do that, but I can probably find something that will.

Ah, I found py2exe and installed it. It shows up nowhere in my Start->All
Programs. It may be in the list under Python. I see a command line entry off
that men. I don't think it was there. Off for more exploring.
--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 13 '08 #4
Ah, a tiny break through. I got
C:\Python24\python myprogram.py aprog.py. I copied the program to this folder.

I don't seem to be able to copy the window, so I see pretty much what I had
before from a dialog that popped up, except it adds:
Fatal Pyton error: Pystring_InterInPlace: strings only please! The rest is
about the run time error.
This (Pystring) seems quite relevant, but I have no idea what.
>

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 13 '08 #5
Thanks for the help, but I'm bowing out of this graphics problem. This
should have been a snap, but has turned into a detour. I'll get back to the
python program I was considering for it, and just work without the scatter
plot. It's easily done. It would just look prettier in a plot.

The meat of the matter is the Fatal error msg I copied below. To me it
indicates a serious error. Maybe some developer can sort it out.

From above post.
++++++++++++++++++++++++++++++++++
Ah, a tiny break through. I got
C:\Python24\python myprogram.py aprog.py. I copied the program to this folder.

I don't seem to be able to copy the window, so I see pretty much what I had
before from a dialog that popped up, except it adds:

Fatal Python error: Pystring_InterInPlace: strings only please! <-Meat!

The rest is about the run time error [, and of zippo help].

This (Pystring) seems quite relevant, but I have no idea what.
+++++++++++++++++++++++++++++++++++
--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 13 '08 #6
En Sun, 12 Oct 2008 23:45:15 -0300, W. eWatson <no*******@sbcglobal.net>
escribió:
The meat of the matter is the Fatal error msg I copied below. To me it
indicates a serious error. Maybe some developer can sort it out.

From above post.
++++++++++++++++++++++++++++++++++
Ah, a tiny break through. I got
C:\Python24\python myprogram.py aprog.py. I copied the program to this
folder.

I don't seem to be able to copy the window, so I see pretty much what I
had before from a dialog that popped up, except it adds:

Fatal Python error: Pystring_InterInPlace: strings only please! <-Meat!

The rest is about the run time error [, and of zippo help].

This (Pystring) seems quite relevant, but I have no idea what.
+++++++++++++++++++++++++++++++++++
Python 2.4 is almost four years old now, and unmaintained. Chances are the
bug is already fixed. With 2.6 already released (and 3.0 soon to be) I
think it's highly improbable any developer will show interest in this - in
any case, almost noone will notice unless you file a bug at bugs.python.org

--
Gabriel Genellina

Oct 14 '08 #7
Gabriel Genellina wrote:
En Sun, 12 Oct 2008 23:45:15 -0300, W. eWatson <no*******@sbcglobal.net>
escribió:
>The meat of the matter is the Fatal error msg I copied below. To me it
indicates a serious error. Maybe some developer can sort it out.

From above post.
++++++++++++++++++++++++++++++++++
Ah, a tiny break through. I got
C:\Python24\python myprogram.py aprog.py. I copied the program to this
folder.

I don't seem to be able to copy the window, so I see pretty much what
I had before from a dialog that popped up, except it adds:

Fatal Python error: Pystring_InterInPlace: strings only please! <-Meat!

The rest is about the run time error [, and of zippo help].

This (Pystring) seems quite relevant, but I have no idea what.
+++++++++++++++++++++++++++++++++++

Python 2.4 is almost four years old now, and unmaintained. Chances are
the bug is already fixed. With 2.6 already released (and 3.0 soon to be)
I think it's highly improbable any developer will show interest in this
- in any case, almost noone will notice unless you file a bug at
bugs.python.org
Thanks. You're probably right. I'm sort of stuck with this (2.4.4). The
supplier of the s/w I am working on distributed it under 2.4. There are a
number of people who are using the program, and aren't python savvy. The
supplier has moved to 2.5. I'm trying to provide a program that will run for
them, and probably 2.5. I find it odd though that this simple program on
the matplotlab never got checked by someone. I suppose it's possible.

I'm giving this one more try (a new post shortly). If not, I'm dragging
everyone up to 2.5.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>

Oct 15 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jean.rossier | last post by:
Hello All, I am facing a problem while importing pylab library(in a .py program file) via web browser however the same program works when I execute it from the command prompt. my...
3
by: Dr. Colombes | last post by:
On my home laptop computer, I'm trying to install the appropriate modules so that Python version 2.3.3 and IDLE version 1.0.2 (with an "import matplotlib.matlab" statement) can produce nice...
0
by: ajikoe | last post by:
I found this error message when I import pylab. from pylab import * Error message: Microsoft Visual C++ Runtime Library Assertion failed! Program:c\python24\python.exe...
2
by: Charles Krug | last post by:
List: I'm trying to us pylab to see what I'm doing with some DSP algorithms, in case my posts about convolution and ffts weren't giving it away. I've been using pylab's plot function, but I'm...
2
by: timw.google | last post by:
Hi all. I installed matplotlib 0.87.3 under Python 2.4 on both Linux (FC3) and Windows XP Pro. On the linux install, I can import pylab, but when I try to do the same thing on the Windows...
14
by: amitsoni.1984 | last post by:
hi, I have some values(say from -a to a) stored in a vector and I want to plot a histogram for those values. How can I get it done in python. I have installed and imported the Matplotlib package...
3
by: Caren Balea | last post by:
Hello, I'm newbie to python. So far, I'm a bit disappointed. It's awful to set Python up to work. It's not working!!! Ok, calm down. Here are my settings: I'm using Windows XP machine and...
1
by: oyinbo55 | last post by:
I am trying to use the pylab plot command on my laptop running Ubuntu 6.06 (Dapper). Although the plot command works fine on my XP desktop at work, I cannot open the plot window on the laptop. I...
3
by: Willem-Jan Vriend | last post by:
I want to use pylab (matplotlib) on a machine without X11. I'm trying to generate onthefly graphics for an apache2 web service, so they do not have to be displayed on this machine ! When i do...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.