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.
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.
If anyone can help me straighten this out, I'd really apppreciate
it.
TIA
--
Best Regards,
Mike 4 5329
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.
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.
regards
Steve
[ReportLab's US rep]
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
Active8 wrote: On Mon, 30 Aug 2004 23:24:08 -0400, Steve Holden wrote:
[...how to install ReportLab's open source code...] 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.
Aha. The magic word is "package". See below. 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
Right, but this is because you chose to unzip INTO a directory you had
created called ReportLab_1_19. 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 ...
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.
Right. You are complicating things WAY beyond what they need to.
Something I am prone to do myself, so I feel a certain sympathy.
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
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
This will indicate to the interpreter that it can look in that directory
for the reportlab package, and bingo, you are done.
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.
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
If you can't import reportlab, what makes you think you'll be able to
import one of its sub-packages? :^)
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.
Basically you are just being confused by the extra directory level
you've added, plus lack of knowledge about packages, which will be a bit
confusing until you've seen one in action.
I don't think it helps that packages aren't well-described in the
mainstream documentation, 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.
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.
regards
Steve
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Andreas Jung |
last post by:
Reportlab has some problems with creating PDFs from UTF8 encoded text. For
this reason
they are using a truetype font rina.ttf which looks *very ugly*. Does
anyone know of a
suitable free...
|
by: Robin Becker |
last post by:
Version 1.19 of the ReportLab Toolkit has been released.
Fixes from Max Neunhöffer (pyRXP) and Peter Borocz (pdfmetrics).
ReportLab graphics now has some 3D charts.
Support for True Type Fonts in...
|
by: qwweeeit |
last post by:
The pythonic way of programming requires, as far as I know, to spread a
big application in plenty of more manageable scripts, using import or
from ... import to connect the various modules.
In...
|
by: jean-marc |
last post by:
As an application programmer, I'm not well versed in the material
aspects of computing (memory, cpu, bus and all). My understanding of
imports in Python is such: the __main__ program is the center...
|
by: Méta-MCI |
last post by:
Hi!
I try to generate PDF from Python 2.5 + ReporLab_lib, and, I have:
C:\Python25\reportlab\pdfbase\ttfonts.py:407: DeprecationWarning: struct
integer overflow masking is deprecated...
|
by: rshepard |
last post by:
I'm stymied by what should be a simple Python task: accessing the value of
a variable assigned in one module from within a second module. I wonder if
someone here can help clarify my thinking. I've...
|
by: Hussein B |
last post by:
Hey,
Suppose I have a Python application consists of many modules (lets say
it is a Django application).
If all the modules files are importing sys module, how many times the
sys module will be...
|
by: rs387 |
last post by:
Hi,
I've found the following behaviour on importing a variable from a
module somewhat odd. The behaviour is identical in Python 2.5 and
3.0b2.
In summary, here's what happens. I have a...
|
by: Laszlo Nagy |
last post by:
I need to create multi lingual invoices from reportlab. I think it is
possible to use UTF 8 strings but there is a problem with the font. I
could not find any free TTF font that can do latin1,...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |