Mck AST
Mck AST

Reputation: 31

Cx_Freeze build is not including python libraries in zip file

I'm in trouble with cx_Freeze 5.0 I'm working on: Windows 10 LTSB x64 Python 3.4.4 x86 PyQt5 PyWin32 x86

I never had any issue with this process until I reinstall my Windows10 installation... it was working great and now I can't figured it out why it's happening ...

When I Freeze my python app (python setup.py build) script is copying the whole python libraries outside the python34.zip. The only thing I got inside python34.zip is *.pyc files (only this.. but a lot)

I don't know why it doesnt include python libraries now and didnt find any options/config, it has to include this automatically ...

If someone can help with this.. :)

Note: nothing has changed in my setup.py, simple setup.py file, copied from standard example just including one asset folder (this one is correctly copied.. no issues)

Thanks !

cx_Freeze build output

Upvotes: 2

Views: 4099

Answers (1)

vashekcz
vashekcz

Reputation: 571

I encountered the same problem (if it is indeed a problem) after upgrading to cx_Freeze 5.x. I believe it's mentioned in the changelog here: https://cx-freeze.readthedocs.io/en/latest/releasenotes.html

  1. Added support for storing packages in the file system instead of in the zip file. There are a number of packages that assume that they are found in the file system and if found in a zip file instead produce strange errors. The default is now to store packages in the file system but a method is available to place packages in the zip file if they are known to behave properly when placed there. (Issue #73)

(emphasis mine) That "method" is apparently described in https://cx-freeze.readthedocs.io/en/latest/distutils.html#build-exe, specifically the zip_include_packages and zip_exclude_packages options.

I ended up putting the following as a keyword argument to my setup() call, which solved it for me:

options = {"build_exe": {"include_msvcr": True, "include_files": dataFiles, "packages": ["lxml", "idna"], "zip_include_packages": "*", "zip_exclude_packages": ""}},

Upvotes: 5

Related Questions