簡體   English   中英

CXFreeze:ModuleNotFoundError:沒有名為“skimage.feature._orb_descriptor_positions”的模塊

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM