Traceback (most recent call last): PROBLEM

smarras at smarras at
Fri Oct 12 14:59:51 CEST 2007

Hello everyone, I keep obtaining an error message whenever I execute some
very simple routines; the error that follows says that I am calling
certain functions that, in reality, I am not calling from any of the
routines that I wrote:


> python

  0, 0, 0, 0 ,  0, 1, 2, 3 ,  0, 2, 4, 6
Traceback (most recent call last):
  File "", line 7, in <module>
    from xlrd import *
line 256, in <module>
    from timemachine import *
line 21, in <module>
    from array import array as array_array
ImportError: cannot import name array

In these lines that I pasted, for example the "array-looking" string has
nothing to do with my function, nor the import name "timemachine" or the
import name "array".

Can anyone help me understand why python is looking such libraries, and
why it keeps in memory an array that I am not using?

Here also the simple routine I wrote:

import os, sys
import xlrd
from numpy import *
from Numeric import *
from matplotlib import *

book = xlrd.open_workbook("/Users/simone/Desktop/prova.xls")
print "The number of worksheets is", book.nsheets
print "Worksheet name(s):", book.sheet_names()
sh = book.sheet_by_index(0)
print, sh.nrows, sh.ncols
for i in range(sh.nrows):
	for j in range(sh.ncols):
		print sh.row(i)
		print sh.cell_value(i, j)

More information about the Python-list mailing list