PyInstaller: a module is not included into --onefile, but works fine with --onedir

后端 未结 2 642
执念已碎
执念已碎 2021-02-05 17:59

I\'m using PyInstaller to bundle my application into one .exe file. The problem is that it works fine with --onedir option, but can\'t find a module when built with --onefile.

2条回答
  •  北海茫月
    2021-02-05 18:56

    just import following packages in the script which is going to convert into exe file

     import xgboost
     import sklearn.ensemble
     import sklearn.tree
     import pickle
     import pandas as pd
     import sklearn.neighbors.typedefs
     import sklearn.neighbors.quad_tree
     import sklearn.tree._utils
     import cython
     import sklearn
     import sklearn.utils._cython_blas
     import numpy as np
     import joblib
     from sklearn.preprocessing import StandardScaler
    

    this help me in solving this issue.

提交回复
热议问题