Need help importing/installing reportlab module

Active8 reply2group at ndbbm.net
Tue Aug 31 06:48:24 CEST 2004


On Mon, 30 Aug 2004 23:24:08 -0400, Steve Holden wrote:

> Active8 wrote:
> 
>> I did this once and can't remember how <blush> so I read the
>> reportlab user guid. It says to unzip the reportlab archive - this
>> is on w2k, BTW, with Python23 - to a directory and make a file
>> called reportlab.pth in the pythod dir. The only line in this file
>> is supposed to be the path to the reportlib dir.
>> 
> When you unpack the ReportLab archive (I downloaded ReportLab_1_19.zip) 
> it creates a reportlab-1_19 directory (in my case in the C:\Steve 
> directory), with a reportlab subdirectory that is the package you want 
> to import.
> 
> My Python is installed in C:\Python23, so I created a 
> C:\Python23\reportlab.pth file which contained the single line
> 
> 	C:\Steve\reportlab-1_19
> 
> Lo! "import reportlab" now works, and you should be good to go.
> 
>> Then I'm instructed to open the ... ok I'll close and reopen ... the
>> python cmd line interpreter and type
>> 
>> import reportlab
>> 
>> so I get
>> 
>> Import Error: no module named reportlab
>> 
>> not too surprizing since I can't find anything named reportlab in
>> the archive. I did basically the same thing to install PIL and that
>> worked. I did also download rl_win32_2_3 and move those .pyd files
>> to the pythod dll dir - I assume a pyd is a python dll - worked for
>> PIL.
>> 
> I'd be rather concerned that you can't find "reportlab" in the archive. 
> Basically all it contains is a "reportlab" package directory with the 
> code in it.
That's what I see, just no .py or other files named reportlab.
> 
>> If anyone can help me straighten this out, I'd really apppreciate
>> it.
>> 
>> TIA
> 
> Well if this doesn't fix it, please let me know.
> 
when I unzip, I get

.\ReportLab_1_19\reportlab-1_19

which contains manifest.txt and the reportlab dir where the actual
python code is. I've tried putting both subdirs under d:\ and
changed the reportlab.pth path accordingly. I've changed the .pth
file from DOS to unix and back because I read somewhere that the
line termination char musst be just so - and I'm not even sure I got
that right, but there's a newline in there. I even tried it without
a newline.

I've tried forward and backslashes. Also tried running
test_pdfgen_general.py from the command line and the python
interpreter - can't type "d:\report* because python doesn't like
colons - ..\report* - it doesn't like dots, either. But when I run
it from the windows command line, it says that in 

line 12 of test_pdfgen_general.py

from reportlab.test import unittest
Import Error: no module named reportlab.test

But I checked that test\ dir and unittest.py is there. If that's a
clue, I don't know what to make of it.

I recall installing another module - maybe PIL. When I tried that
from x import y thing, I got an error, but the next instruction was
to just type import PIL or whatever, and that didn't throw any
errors.

I'm pretty confused that it worked so well for you and isn't for me.
The instructions can't be simpler.

-- 
Best Regards,
Mike



More information about the Python-list mailing list