[reportlab-users] NameError: name '__loader__' is not defined

Robin Becker robin at reportlab.com
Mon Nov 20 08:39:46 EST 2006


dimitri pater wrote:

> Hello,

> I am new here to this list...

> I have just installed reportlab 2.0 using the .tgz from the

> reportlab.orgwebsite and installed it on my Linux Suse

> 10.1 laptop. Import reportlab works from the Python command line. But the

> first example from the reportlab doc throws an exeption (my ide is

> WingIDE):

>

>

> NameError: name '__loader__' is not defined

>

> Traceback (innermost last):

>

> File "/home/metroviewer/Desktop/reportlab_2_0/reportlab/test/runAll.py",

> line 1, in ?

> #!/usr/bin/env python

> File "/home/metroviewer/Desktop/reportlab_2_0/reportlab/test/runAll.py",

> line 93, in ?

> main()

> File "/home/metroviewer/Desktop/reportlab_2_0/reportlab/test/runAll.py",

> line 41, in main

> from reportlab.lib.utils import isSourceDistro

> File "/usr/local/lib/python2.4/site-packages/reportlab/lib/utils.py", line

> 147, in ?

> _isFSD = not __loader__

>

> I also get this error running the runAll.py

>

> Any idea? Your help is appreciated.

> Thanks,

> Dimitri

......

Peculiar. The 2.0 tag branch of utils.py has a try block around that statement

eg

try:
_isFSD = not __loader__
.......
.......
except:
#do something else

I notice that you appear to have
/home/metroviewer/Desktop/reportlab_2_0/reportlab/ in one place and
/usr/local/lib/python2.4/site-packages/reportlab/ in another so the older
version of reportlab may be buggy.

A way round this (and a check) would be to try setting this in your environment
before running the test


export PYTHON=/home/metroviewer/Desktop/reportlab_2_0
python /home/metroviewer/Desktop/reportlab_2_0/reportlab/test/runAll.py


--
Robin Becker


More information about the reportlab-users mailing list