You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem encountered
During execution of my setup.py, the following error is thrown, after a long list of calls:
File "C:...\miniconda3\envs\testenv\Lib\site-packages\cx_Freeze\hooks\mkl.py", line 29, in load_mkl
if distribution.installer == "pip":
AttributeError: 'NoneType' object has no attribute 'installer'
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.
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.
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
Conda environnement with:
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
The text was updated successfully, but these errors were encountered: