py2exe - Compiling Python to an exe -


for last week have been struggling compile few python scripts , pyqt .ui file exe using pyinstaller/py2exe. new programming , have never tried package application distribution before.

so far have succeeded in simplifying gui application 1 python script, when try compile it, using either py2exe or pyinstall, same error.

with pyinstaller error is:

c:\python27\pyinstaller-2.0>python utils\build.py costaharmplotter.spec 109 info: testing ability set icons, version resources... 187 info: ... resource update available 203 info: upx not available. 2515 warning: library python%s%s required via ctypes not found 2625 info: checking analysis 2625 info: building analysis because out00-analysis.toc non existent 2625 info: running analysis out00-analysis.toc 2625 info: adding microsoft.vc90.crt dependent assemblies of final executable  2640 info: searching assembly x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21 022.8_x-ww ... 2640 info: found manifest c:\windows\winsxs\manifests\x86_microsoft.vc90.crt_1fc 8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375.manifest 2656 info: searching file msvcr90.dll 2656 info: found file c:\windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 9.0.21022.8_x-ww_d08d0375\msvcr90.dll 2656 info: searching file msvcp90.dll 2656 info: found file c:\windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 9.0.21022.8_x-ww_d08d0375\msvcp90.dll 2656 info: searching file msvcm90.dll 2656 info: found file c:\windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 9.0.21022.8_x-ww_d08d0375\msvcm90.dll 2812 info: analyzing c:\python27\pyinstaller-2.0\support\_pyi_bootstrap.py 5484 warning: library python%s%s required via ctypes not found 5562 info: analyzing c:\python27\pyinstaller-2.0\pyinstaller\loader\archive.py 5875 info: analyzing c:\python27\pyinstaller-2.0\pyinstaller\loader\carchive.py 6297 warning: pywintypes changing name pywintypes27 6797 info: analyzing c:\python27\pyinstaller-2.0\pyinstaller\loader\iu.py 6843 info: analyzing costaharmplotter.py traceback (most recent call last):   file "<string>", line 1, in <module>   file "c:\python27\lib\lib-tk\tkinter.py", line 1844, in tcl     return tk(screenname, basename, classname, usetk)   file "c:\python27\lib\lib-tk\tkinter.py", line 1745, in __init__     self.tk = _tkinter.create(screenname, basename, classname, interactive, want objects, usetk, sync, use) _tkinter.tclerror: can't find usable init.tcl in following directories:     {c:\tcl\lib\tcl8.5} c:/python27/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/li brary c:/library c:/tcl8.5.2/library c:/tcl8.5.2/library  c:/tcl/lib/tcl8.5/init.tcl: version conflict package "tcl": have 8.5.2, need  8.5.13 version conflict package "tcl": have 8.5.2, need 8.5.13     while executing "package require -exact tcl 8.5.13"     (file "c:/tcl/lib/tcl8.5/init.tcl" line 18)     invoked within "source c:/tcl/lib/tcl8.5/init.tcl"     ("uplevel" body line 1)     invoked within "uplevel #0 [list source $tclfile]"   means tcl wasn't installed properly. 

i similar error py2exe:

c:\documents , settings\t53983\desktop\harmonicplottergui>python setup.py py2e xe running py2exe *** searching required modules *** *** parsing results *** traceback (most recent call last):   file "setup.py", line 4, in <module>     setup(data_files=['c:\\python27\\tcl\\tcl8.5\\init.tcl'], console = ['costah armplotter.py'])   file "c:\python27\lib\distutils\core.py", line 152, in setup     dist.run_commands()   file "c:\python27\lib\distutils\dist.py", line 953, in run_commands     self.run_command(cmd)   file "c:\python27\lib\distutils\dist.py", line 972, in run_command     cmd_obj.run()   file "c:\python27\lib\site-packages\py2exe\build_exe.py", line 243, in run     self._run()   file "c:\python27\lib\site-packages\py2exe\build_exe.py", line 299, in _run     py_files, extensions, builtins = self.parse_mf_results(mf)   file "c:\python27\lib\site-packages\py2exe\build_exe.py", line 1097, in parse_ mf_results     tk = _tkinter.create() _tkinter.tclerror: can't find usable init.tcl in following directories:     {c:\tcl\lib\tcl8.5} c:/python27/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/li brary c:/library c:/tcl8.5.2/library c:/tcl8.5.2/library  c:/tcl/lib/tcl8.5/init.tcl: version conflict package "tcl": have 8.5.2, need  8.5.13 version conflict package "tcl": have 8.5.2, need 8.5.13     while executing "package require -exact tcl 8.5.13"     (file "c:/tcl/lib/tcl8.5/init.tcl" line 18)     invoked within "source c:/tcl/lib/tcl8.5/init.tcl"     ("uplevel" body line 1)     invoked within "uplevel #0 [list source $tclfile]"   means tcl wasn't installed properly. 

in script, use numpy, pyqtgraph.plotwidget, pyqt4.qtcore , pyqt4.qtgui.

  • why py2exe/pyinstaller looking tcl if didn't use tkinter?
  • how go excluding package causing problem? switched tcl file tcl 8.5.13 tcl 8.5.2 still doesn't work.

please not link me py2exe/pyinstaller documentation, have been reading past few days , still struggling understand how of options work. post setup.py file , spec file below reference.

setup.py file:

from distutils.core import setup import py2exe  setup(console = ['costaharmplotter.py']) 

spec file:

# -*- mode: python -*- = analysis(['costaharmplotter.py'],              pathex=['c:\\python27'],              hiddenimports=[],              hookspath=none) pyz = pyz(a.pure - [('tkinter','c:\\python27\\lib\\lib-tk','pymodule')]) exe = exe(pyz,           a.scripts,           exclude_binaries=1,           name=os.path.join('build\\pyi.win32\\costaharmplotter', 'costaharmplotter.exe'),           debug=false,           strip=none,           upx=true,           console=true ) coll = collect(exe,                a.binaries,                a.zipfiles,                a.datas,                strip=none,                upx=true,                name=os.path.join('dist', 'costaharmplotter')) 

last time tried py2exe, couldn't work newer python 2.6. looking @ sourceforge, , old update/news page, looks there still isn't support newer 2.6/2.7.

it looks you're using 2.7, try compiling python 2.6 instead.


Comments