Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10255
| From | Robin Becker <robin@reportlab.com> |
|---|---|
| Subject | Re: reportlab import error after dundled using py2exe |
| Date | 2011-07-25 11:28 +0100 |
| References | <CAFHq_S7DfeK2ZOKY+x43HwU_pMuB75DWJ8V=+qgJA967sO48Og@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1448.1311589752.1164.python-list@python.org> (permalink) |
On 22/07/2011 03:55, SANKAR . wrote: > Hi all, > ........ > > C:\Python26\dist>DELchek.exe > Traceback (most recent call last): > File "DELchek.py", line 12, in<module> > File "reportlab\pdfgen\canvas.pyc", line 25, in< > File "reportlab\pdfbase\pdfdoc.pyc", line 22, in > File "reportlab\pdfbase\pdfmetrics.pyc", line 23, > File "reportlab\pdfbase\_fontdata.pyc", line 158, > ImportError: No module named _fontdata_enc_winansi > > But I could see the '_fontdata_enc_winansi' module in reportlab folder. > Could someone help me to fix this. > ......... You can try asking this in the reportlab list reportlab-users@lists2.reportlab.com but perhaps this is more about py2exe than reportlab. The modules _fontdata_enc_* & _fontdata_widths_* are imported dynamically in _fontdata.py rather than explicitly. I suspect that py2exe needs to be given a hint that this is going on. However, I'm uncertain as to why this should be required since even if the imports are being dynamically imported that is done as soon as _fontdata is imported (ie it's part of the module code) so those modules should be seen by the setup.py. If you don't have reportlab explicitly imported as part of the packages try adding this to the packages list packages=[ ........................................ 'reportlab', 'reportlab.graphics.charts', 'reportlab.graphics.samples', 'reportlab.graphics.widgets', 'reportlab.graphics.barcode', 'reportlab.graphics', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platypus', ], that's what we use to make the distributions and seems to work. -- Robin Becker
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: reportlab import error after dundled using py2exe Robin Becker <robin@reportlab.com> - 2011-07-25 11:28 +0100
csiph-web