我正在使用cx_freeze
将我的 Python 应用程序转换为 Windows 可执行文件。我pandas-profiling
在我的一个脚本中使用包。当我运行我的 exe 文件时,我收到以下错误:
File "C:\Users\Ronnie\python3.6\Lib\site-packages\pandas_profiling\__init__.py", line 10, in <module>
import pandas_profiling.templates as templates
File "C:\Users\Ronnie\python3.6\Lib\site-packages\pandas_profiling\templates.py", line 64, in <module>
row_templates_dict = {'NUM': template('row_num'),
File "C:\Users\Ronnie\python3.6\Lib\site-packages\pandas_profiling\templates.py", line 60, in template
return jinja2_env.get_template(templates[template_name], globals=globals)
File "C:\Users\Ronnie\python3.6\Lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "C:\Users\Ronnie\python3.6\Lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "C:\Users\Ronnie\python3.6\Lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\Ronnie\python3.6\Lib\site-packages\jinja2\loaders.py", line 234, in get_source
if not self.provider.has_resource(p):
File "C:\Users\Ronnie\python3.6\Lib\site-packages\pkg_resources\__init__.py", line 1396, in has_resource
return self._has(self._fn(self.module_path, resource_name))
File "C:\Users\Ronnie\python3.6\Lib\site-packages\pkg_resources\__init__.py", line 1449, in _has
"Can't perform this operation for unregistered loader type"
NotImplementedError: Can't perform this operation for unregistered loader type
如果我将它pandas-profiling
放在与 exe 文件相同的目录中然后运行它,我会收到以下错误:
error: unrecognized arguments: --multiprocessing-fork 1448
在寻找多处理错误的解决方案时,我发现它pandas-profiling
正在其中一个脚本中使用multiprocessing
,并且需要multiprocessing.freeze_support()
在该模块中调用,但我不知道在哪里添加它。
任何帮助,将不胜感激。