From: Shalin S. <sha...@gm...> - 2013-07-12 18:28:40
|
Hello , I have used pyBarcode library to generate Barcode in my software and its works perfectly fine while I load it from command line but once I freeze the entire software using py2exe I am getting IO error while generating the barcode. File "panels.pyc", line 383, in generateFile "barcodeGenerator.pyc", line 9, in generateFile "barcode\base.pyc", line 68, in saveFile "barcode\codex.pyc", line 251, in renderFile "barcode\base.pyc", line 103, in renderFile "barcode\writer.pyc", line 188, in renderFile "barcode\writer.pyc", line 280, in _paint_textFile "PIL\ImageFont.pyc", line 248, in truetypeFile "PIL\ImageFont.pyc", line 146, in __init__IOError: cannot open resource Here panels.py is my python script from where I call generate method of barcodeGenerator.py whose code is given below. barcodeGenerator.py :- import barcodefrom barcode import generatefrom barcode.writer import ImageWriterfrom PIL import PngImagePlugin def generate(details,path): EAN = barcode.get_barcode_class('code128') ean = EAN(details, writer=ImageWriter()) barcodePic = ean.save(path + 'barcode') And yes the setup.py file using which is freeze is:- from distutils.core import setup import py2exe includes = ["HuffmanDictionary"] setup( options = { "py2exe": {"includes": includes} }, console=['MainFrame.py',"extraModules.py","encode.py","decode.py","panels.py","barcodeGenerator.py" ]) Please could some one point the error I made.I am very close to completing the entire software this is the last bug and I am using windows 7 64 bit. I have already read this http://www.py2exe.org/index.cgi/PILAndFontfiles and downloaded these files from https://code.google.com/p/sethesys/source/browse/trunk/windows/Lib/?r=6#Lib but this didn't solve my issue. -- Yours Sincerely, Shalin Shah |