Importing pylab causes exception - any ideas?

Hi,

Find attched log.txt generated when trying to run your script. Any thoughts?

Regards

Jon

Friedrich Romstedt wrote:

2010/3/12 Jon Moore <jonr_moore@...225...>:
  

I tried getting a colleague of mine to carryout your email but without any
joy. Trying the import commands you suggested my colleague reported .mpl
.dates and .pyplot all crashed with the same exception but .mlab worked ok.
The
import matplotlib.pylab with the custom import command didn't work as the
exception occurs and the console (spyder) shuts down, so cannot see what
happened. IPython also does the same, I'd like to try IDLE at some point.

My colleague couldn't get the log file stuff to work (maybe as she doesn't
normally use python), so I may have to wait until I'm next back there in 4-5
weeks to report back properly.
    
Ok, maybe send your colleague the script attached. Simply run:

$ python crashtest.py

It creates ./log.txt with the log output of the packages attempted to
load. The last line is the offending import. I also attach the
result of my fully successful run.

And when you find something out, maybe send it also to the list.

Lots of success!
Friedrich

__________ Information from ESET NOD32 Antivirus, version of virus signature database 5027 (20100414) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__________ Information from ESET NOD32 Antivirus, version of virus signature database 5027 (20100414) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

log.txt (8.6 KB)

2010/4/14 Jon Moore <jonr_moore@...225...>:

Hi,

Find attched log.txt generated when trying to run your script. Any
thoughts?

Sounds like a typo to me. Please give the new version of crashtest.py
a try, it prints stack tracebacks for each import statement into the
file, so we *should* be able to track it down with this.

The log file created with "#import calendar" commented out is already
20kB large, so maybe too large for the list. Your will be expected to
be some megabytes I guess :frowning: but only the last traceback should
matter.

Also I noticed that our import history is *quite* different. Make a
vimdiff or similar of my old log.txt and the log.txt you provided.
Note that I cannot make a working import because I have no mpl
currently on this MacBook.

Here comes an example output:

import operator, traceback follows:
  File "crashtest.py", line 24, in <module>
    import calendar
  File "crashtest.py", line 18, in new_import
    return old_import(name, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/calendar.py",
line 10, in <module>
    import locale as _locale
  File "crashtest.py", line 18, in new_import
    return old_import(name, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py",
line 202, in <module>
    import re, operator
  File "crashtest.py", line 17, in new_import
    traceback.print_stack()

so far,
hth,
Friedrich

crashtest.py (587 Bytes)