Closed donsylvano closed 3 months ago
Hi!
Change the line that throws the error:
if distribution.installer == "pip":
by
if distribution and distribution.installer == "pip"
and give a feedback. I should publish the fix soon.
Sometimes the guy just says 'there was an error', and doesn't even include the long traceback. I want to fix it, but without information it's difficult. As for you, you went to the trouble of finding a workaround. That is great.
Hello, All good! After changing the line as mentioned, no more exception and the setup succeeded. Thanks for the quick response and for the feedback.
Release 7.1.1 is out! Documentation
Problem encountered During execution of my setup.py, the following error is thrown, after a long list of calls:
The fact that disabling the load_mkl function solved the problem indicates that there may be a bug in the mkl hook.
To Reproduce I created a fresh conda environnement using miniconda. My script is very short, but it needs pandas, therefore numpy and mkl, as dependecies.
Expected behavior As far as I understand, the hooks are there to help with importing specific libraries. In this case it seems to add a bug. I found the following workaround for my specific situation:
Workaround After commenting out the code of the load_mkl function in hooks/mkl.py, the setup is able to create the .exe without any errors, and the resulting program runs successfully.
Desktop
setup.py `# -- coding: latin-1 --
from cx_Freeze import setup, Executable
import glob import os import sys import shutil
includes = ['numpy','pandas','mkl'] excludes = [] packages = ['numpy', 'pandas', 'mkl'] bin_excludes = [] include_files=['test.csv']
build_exe_options = { "optimize": 0, "includes": includes, "excludes": excludes, "packages": packages, "include_files": include_files, "bin_excludes": bin_excludes }
setup( name="bs_json", version="1.0", description = "Read JSON from file", options = {"build_exe": build_exe_options}, executables = [Executable("bs_json.py", base=None)] )`
Footnote This is my first issue report on GitHub. Any constructive feedback welcome