【发布时间】:2020-12-25 05:06:43
【问题描述】:
from sklearn.externals import joblib
import pickle
import pandas as pd
# Load the model from the file
knn_from_joblib = joblib.load('lm.pkl')
X_test= pd.read_excel('input.xlsx')
# Use the loaded model to make predictions
final_Data= X_test
predictions = knn_from_joblib.predict(X_test)
predictions
final_Data['Predicted Yield']= predictions
final_Data.to_excel("predictions.xlsx")
当我从这个文件制作 exe 并运行那个 exe 文件时,我得到了下面的错误
当我从 IDE 运行 .py 文件时,它运行良好。
【问题讨论】:
-
我试过了,但出现了更多错误,当我在 Spyder 之类的 IDE 中运行 .py 代码时,它可以工作,但在 pyinstaller 中却不行
标签: python python-3.x scikit-learn pyinstaller joblib