Need help importing/installing reportlab module
Active8
reply2group at ndbbm.net
Tue Aug 31 10:01:15 EDT 2004
On Tue, 31 Aug 2004 07:52:32 -0400, Steve Holden wrote:
<snip>
>> when I unzip, I get
>>
>> ..\ReportLab_1_19\reportlab-1_19
>>
> Right, but this is because you chose to unzip INTO a directory you had
> created called ReportLab_1_19.
Actually, that's one of the context menu options winrar suggests -
the name of the zip file.
> If you look at the archive with WinZip or
> similar, you'll see that it essentially bundles everything into a
> reportlab-1_19 directory. That directory contains only two things: you
> identify them in your next bit. Not sure what the "..\" is doing in your
> path up there ...
Sorry, should have been "." IOW I unzipped it into the dir it was
saved in and let winrar create a dir named after the zip archive.
>
<snip all the nitpicky stuff I tried>
>>
> Right. You are complicating things WAY beyond what they need to.
> Something I am prone to do myself, so I feel a certain sympathy.
As it says at your site, Python folks are nice - liked the success
matrix bit, too :) i.e., the "...two ways into..." article linked
from the home page.
>
> Delete everything you've done so far and unpack the archive into the
> root directory on your D: drive. (or move what you have already, if you
> feel confident doing that and you haven't messed about with the contents
> of the package). This will create
>
> D:\reportlab-1_19\MANIFEST.txt
> D:\reportlab-1_19\reportlab\__init__.py
Done
>
> and a whole bunch of other stuff. What you are supposed to import is the
> D:\reportlab-1_19\reportlab DIRECTORY: it's a package, as indicated by
> the presence of the __init__.py file.
>
> So, having got this far, you now need to create a .pth file that Python
> will find (the easiest way to ensure that is to create it in the same
> directory as your python.exe interpreter binary). It doesn't matter what
> it's called, as long as its name ends in ".pth". It needs to contain
> just one line, which reads
>
> D:\reportlab-1_19
Done. Even tried D:\reportlab-1_19\reportlab after the above line
failed - just in case. Erm... I just shut down and started python
again and it reread the path file and works. Screw myself :( Recall
I mentioned shutting it down once before? Maybe I didn't do that
often enough. Wish I knew, cause this has been what I'd call a PITA
compared to the last time I installed this package.
>
> This will indicate to the interpreter that it can look in that directory
> for the reportlab package, and bingo, you are done.
Mekes sense. Python finds what is now paths.pth in the same dir as
its executable, etc.
>
> Note that if you install multiple packages you can add a line to the
> same .pth file for each of the packages you want Python to find, but
> that needn't concern you just now.
Maybe not, but it'll save a post later.
<snip my other futile, wheel spinning endeavors>
> [...] and I would encourage you to read the
> description in the tutorial [Section 6.4 in my 2.3 documentation]. It
> also doesn't really help that type(reportlab) is reported as <type
> 'module'>, adding to the potential for confusion, but once you have used
> packages for a while it seems like a very natural way to bundle related
> pieces of functionality.
Agreed and duly noted. How can I forget after this? ;)
But the userguide.pdf has bullets and paragraphs in that section and
I'm sure you're not talking about graphics_reference.pdf. THe report
lab site I downloaded from... sparse. I didn't see add'l docs there.
>From 00readme.txt
"
If you don't see the pdf manual you expected or you wich to
ensure an up to date copy run the script tools/genAll.py!
"
genALL.py is not in tools\, it's in docs\ - where the readme resides
:) heh, heh... documentation's a bitch.
test_pdfgen_general.py seems to work nicely. runAll.py throws no
errors and compiles __init__.py, unittest.py, and utils.py.
genAll.py threw a flurry of messages some WARNs some Errors. I tried
to redirect win console errors to a file, but all those python
errors don't make it there. The first wrning was that the Imaging
Library was not available. Unable to import bitmaps.
Maybe that means PIL? I dunno.
I got graphics_reference.pdf out of the deal. Not sure if there
should be more, but the 00readme says
"
Thid directory holds documentation. For end users,
it should contain a number of PDF manuals. For
people working with the source, this directory will
be the destination for any manuals built.
"
>
> Get back to the group again if you still can't import reportlab - it's
> really worth the effort, honest! I use the o-s toolkit to do all my
> invoicing.
Is that part of reportlab or what? FYI, reportlab is used by a
program called gerber2pdf by Joseph C Chavez. It converts the
industry standard Gerber files from an electronic circuitboard
layout package to pdfs. Kinda handy when you don't have a high $
photoplotter.
--
Best Regards,
Mike
More information about the Python-list
mailing list