本文介绍了cx_Freeze错误:基线图像目录不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用cx_Freeze库在Windows的Anaconda虚拟环境中使用python脚本创建可执行文件。我试图在6.1版中执行此操作,但是我陷入了错误 Intel MKL致命错误:无法加载mkl_intel_thread.dll 。然后我将cx_Freeze升级到6.2版,这是运行 python setup.py build 时得到的输出:

I'm trying to create an executable file out of a python scripts on Windows in Anaconda virtual environment with cx_Freeze library. I was trying to do it with version 6.1 but I was stucked in the error Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll. Then I upgrade cx_Freeze to version 6.2 and this is the output I get when I run python setup.py build:

running build
running build_exe
C:\Users\--\Anaconda3\lib\site-packages\cx_Freeze\finder.py:309: VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated in pyzmq 14.0 and will be removed.
    Install tornado itself to use zmq with the tornado IOLoop.

  deferredImports, namespace = namespace)
Using TensorFlow backend.
2020-07-10 08:51:47.876748: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-07-10 08:51:47.885038: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
C:\Users\--\Anaconda3\lib\site-packages\IPython\html.py:14: ShimWarning: The IPython.html package has been deprecated since IPython 4.0. You should import from notebook instead. IPython.html.widgets has moved to ipywidgets.
  "IPython.html.widgets has moved to ipywidgets.", ShimWarning)
C:\Users\--\Anaconda3\lib\site-packages\IPython\kernel\__init__.py:13: ShimWarning: The IPython.kernel package has been deprecated since IPython 4.0.You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)
error: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.

以下是文件 setup.py 的内容:

from cx_Freeze import setup, Executable

exe = Executable(script="mainDefectDetection.py",targetName="Test.exe")
setup(name = "try", version = "0.1", description = "", options = {'build_exe': {'include_files':["../../../../Anaconda3/Library/bin/mkl_intel_thread.dll"]}},executables = [exe])

我尝试重新安装matplotlib( pip卸载matpolotlib pip安装matplotlib ),但是

I've tried to re-install matplotlib (pip uninstall matpolotlib, pip install matplotlib) but nothing has changed.

推荐答案

我的原始答案:

我有已经确定了此问题的根源,它是补丁7ec3eaa。

I have already identified the source of this problem, it is the patch 7ec3eaa.

U唱matplot示例,我看到numpy 1.18.3到1.19和枕头7.x出现问题,我正在调查。

Using the matplot sample, I see an issue with numpy 1.18.3 to 1.19 and pillow 7.x, and I'm investigating.

目前,它有一种解决方法。

For now, it has a workaround.

pip安装 numpy< 1.18.3; "枕头< 7"

要构建,请添加[ matplotlib.tests, numpy.random._examples]以排除或构建:

To build add ["matplotlib.tests", "numpy.random._examples"] to excludes or build with:

python setup.py build_exe --excludes = matplotlib.tests,numpy.random._examples

如果您有排除在您的setup.py中,将两个排除的模块添加到其中,安装程序中的选项除外。

If you have a "excludes" in your setup.py, add the two excluded modules int it, options in setup is exclusive.

这篇关于cx_Freeze错误:基线图像目录不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 09:52