[reportlab-users] Platypus Gives NameError on Impor

Tim Roberts timr at probo.com
Thu Jun 15 12:58:07 EDT 2006


On Wed, 14 Jun 2006 20:29:06 +0000, Robin Becker <robin at reportlab.com>
wrote:

>Nicholas Urie wrote:
>  
>
>>When I try to run any of the platypus examples in the user guide (p. 56
>>or p. 57), I get the following error:
>>    
>>
>>>NameError: name '__loader__' is not defined
>>>
>>>...File "C:\Python24\reportlab\lib\utils.py", line 147, in ?
>>>  _isFSD = not __loader__
>>>      
>>>
>>testCase.py contains just one line:
>>from reportlab.lib.styles import getSampleStyleSheet
>>
>>a similar NameError (__loader__ is not defined) is caused by the
>>one-line file:
>>from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
>>
>>but running either import command from an interactive python shell works
>>just fine. I'm running Python 2.4.3 and reportlab 2.0 on Windows XP.
>>    
>>
>.......
>
>That's very strange. I wonder if it's because you have installed 
>reportlab in two different places ie
>c:\Documents and Settings\Aardvark\My Documents\reportlab\
>
>vs
>
>C:\Python24\reportlab\
>  
>

It is particularly strange because that statement is wrapped in a
try/except specifically to catch this case.  Nicholas, can you verify
that the lines surrounding that one look exactly like this:

import glob, fnmatch
try:
    _isFSD = not __loader__
    _archive = os.path.normcase(os.path.normpath(__loader__.archive))

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list