I want to make EXE file by use py2exe
or cx_freeze
.
so I was try to make exe file with py2exe but no luck.
so now I was test with cx_freeze
but it also failed.
if anyone can help me much apprecaite
following is setup.py file in cx_freeze
from cx_Freeze
import setup, Executable
copyDependentFiles=True silent = True includes = ["lxml", "lxml._elementpath", "lxml.etree", "gzip", "encodings.cp949", "encodings.utf_8", "encodings.ascii"] setup(name='gearfacts', options = { "build_exe" : { "includes": includes, }, }, executables=[Executable('test.py')], )
following is my script source file.
-- coding: utf-8 --
The Python code you have posted is actually incorrect - if this is the actual code that you are trying to freeze - then you probably get an error along the lines of
File "cx_freeze_test.py", line 35 for line in os.popen("ipconfig /all"): ^ IndentationError: unindent does not match any outer indentation level
I suggest you start with a very simple script, e.g.
print "hello"
Then you should get an error something like:
File "C:\_tools\python2.7.0\lib\site-packages\cx_Freeze\freezer.py", line 632, in __init__ parts = version.split(".") AttributeError: 'NoneType' object has no attribute 'split'
You can see that it is trying to split the version string on '.'. But you have not defined a version in your setup.py.
So... adding that
from cx_Freeze import setup, Executable copyDependentFiles=True silent = True includes = ["lxml", "lxml._elementpath", "lxml.etree", "gzip", "encodings.cp949", "encodings.utf_8", "encodings.ascii"] setup(name='gearfacts', version = "1.1", options = { "build_exe" : { "includes": includes, }, }, executables=[Executable('cx_freeze_test.py')], )
I end up with an EXE that can run after this.