reportlab import error after dundled using py2exe

SANKAR . shankarphy at gmail.com
Tue Jul 26 03:59:21 EDT 2011


your suggestion worked.Thanks Robin.

-Sankar

On Mon, Jul 25, 2011 at 8:28 PM, Robin Becker <robin at reportlab.com> wrote:

> 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 at lists2.**reportlab.com<reportlab-users at 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
>
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110726/508be462/attachment-0001.html>


More information about the Python-list mailing list