[reportlab-users] Platypus Gives NameError on Import

Robin Becker robin at reportlab.com
Wed Jun 14 16:29:06 EDT 2006


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
>>
>> Traceback (innermost last):
>>
>> File "c:\Documents and Settings\Aardvark\My Documents\reportlab\testCase.py", line 1, in ?
>>   from reportlab.lib.styles import getSampleStyleSheet
>> File "c:\Documents and Settings\Aardvark\My Documents\reportlab\testCase.py", line 1, in ?
>>   from reportlab.lib.styles import getSampleStyleSheet
>> File "C:\Python24\reportlab\lib\styles.py", line 6, in ?
>>   from reportlab.lib.colors import white, black
>> File "C:\Python24\reportlab\lib\colors.py", line 8, in ?
>>   from reportlab.lib.utils import fp_str
>> 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\

-- 
Robin Becker


More information about the reportlab-users mailing list