Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10255

Re: reportlab import error after dundled using py2exe

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:using': 0.04; 'importerror:': 0.07; 'imports': 0.07; 'dynamically': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:error': 0.11; '25,': 0.12; 'wrote:': 0.15; '.........': 0.16; 'explicitly.': 0.16; 'hint': 0.16; 'setup.py.': 0.16; 'subject:import': 0.16; 'seems': 0.20; '(most': 0.21; 'header:In- Reply-To:1': 0.22; 'suspect': 0.25; 'traceback': 0.25; 'modules': 0.25; "i'm": 0.27; 'work.': 0.28; 'skip:_ 20': 0.28; 'skip:" 30': 0.28; 'all,': 0.28; 'explicitly': 0.29; 'fix': 0.29; 'module': 0.30; '22,': 0.30; 'folder.': 0.30; 'imported': 0.30; 'this.': 0.31; 'named': 0.32; "skip:' 10": 0.32; 'list': 0.32; 'rather': 0.33; 'asking': 0.33; 'done': 0.33; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'header:User-Agent:1': 0.34; 'however,': 0.34; 'someone': 0.34; 'last):': 0.35; 'skip:" 10': 0.36; 'file': 0.36; 'but': 0.37; 'could': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'perhaps': 0.39; 'should': 0.39; 'header :Mime-Version:1': 0.39; 'help': 0.39; 'to:addr:python.org': 0.39; 'skip:. 40': 0.67; 'soon': 0.73; '..........': 0.84; 'robin': 0.84; 'uncertain': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Robin Becker <robin@reportlab.com>
Subject Re: reportlab import error after dundled using py2exe
Date Mon, 25 Jul 2011 11:28:52 +0100
References <CAFHq_S7DfeK2ZOKY+x43HwU_pMuB75DWJ8V=+qgJA967sO48Og@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host fpc2-nmal8-0-0-cust4.croy.static.cable.virginmedia.com
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0
In-Reply-To <CAFHq_S7DfeK2ZOKY+x43HwU_pMuB75DWJ8V=+qgJA967sO48Og@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1448.1311589752.1164.python-list@python.org> (permalink)
Lines 55
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311589752 news.xs4all.nl 23897 [2001:888:2000:d::a6]:53237
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10255

Show key headers only | View raw


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


Thread

Re: reportlab import error after dundled using py2exe Robin Becker <robin@reportlab.com> - 2011-07-25 11:28 +0100

csiph-web