[英]CXFreeze: ModuleNotFoundError: No module named 'skimage.feature._orb_descriptor_positions'
并感谢您的支持。
我正在尝试使用 cxFreeze 构建一个 .exe。 64 位 Windows 机器上的 Python 3.7 版。 构建过程结束得很好,我有我的 .exe 文件。 问题是当我尝试运行 .exe 时,我最终在图中出现了这个错误:
[![错误信息][1]][1][1]:https://i.stack.imgur.com/kdknx.png
基本上最后一行:
ModuleNotFoundError:没有名为“skimage.feature._orb_descriptor_positions”的模块
让我认为问题可能出在将 skimage 错误导入到 .exe lib 列表中。 这是我的 CXFreeze 设置:
from cx_Freeze import setup, Executable
import os
import scipy
# NOTE: you can include any other necessary external imports here aswell
os.chdir(os.getcwd())
includefiles = [] # include any files here that you wish
scipy_path = os.path.dirname(scipy.__file__)
includefiles.append(scipy_path)
includes = []
#excludes = ['pandas', 'numpy', 'scipy', 'PyQt4', 'PySide', 'Tkinter', 'PIL']
excludes = ['pandas',"matplotlib.tests", "numpy.random._examples"]
packages = ['_mssql', 'uuid']
exe = Executable(
# what to build
script = "main_gui.py", # the name of your main python script goes here
initScript = None,
base = None, # if creating a GUI instead of a console app, type "Win32GUI"
targetName = "main_gui.exe", # this is the name of the executable file
#copyDependentFiles = True,
#compress = True,
#appendScriptToExe = True,
#appendScriptToLibrary = True,
icon = None # if you want to use an icon file, specify the file name here
)
setup(
# the actual setup & the definition of other misc. info
name = "main_gui", # program name
version = "0.1",
description = 'test',
author = "test",
author_email = "test@test.com",
options = {"build_exe": {"excludes":excludes,"packages":packages,
"include_files":includefiles, "optimize": 0}},
executables = [exe]
)
谢谢你的帮助!
看起来您正在使用 skimage,但不包括它。 你应该(至少)为 skimage 做你为 SciPy 做的事情:
scipy_path = os.path.dirname(scipy.__file__)
includefiles.append(scipy_path)
所以:
import skimage
skimage_path = os.path.dirname(skimage.__file__)
includefiles.append(skimage_path)
免责声明:我不熟悉 cxFreeze,但我认为这就是它查找编译二进制文件的方式,其中 scikit-image 有一些。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.