Issues with AutoTS Model Evaluation After Converting Python Script to Executable Using PyInstaller

I’m encountering an issue when running my Python script, which uses the AutoTS library, after converting it into an executable using PyInstaller. The script works perfectly in Python, but when I run the executable, I get the following error message:

Error running AutoTSmodel: "Evaluation Metrics are missing and all models have failed, by an error in template or metrics.
There are many possible causes for this, bad parameters, environment, or an unreported bug.
Usually this means you are missing required packages for the models like fbprophet or gluonts,
or that the models in model_list are inappropriate for your data.
A new starting template may also help. KeyError('smape')"

Here’s a simplified version of my code:

import tkinter as tk
from tkinter import filedialog, messagebox
import pandas as pd
from autots import AutoTS
import logging

logging.basicConfig(filename="app.log", level=logging.DEBUG, format='%(asctime)s %(message)s')

class App:
    def __init__(self, master):
        self.master = master
        # Initialization and UI setup code...
    
    def load_excel_file(self):
        # Code to load Excel file...

    def run_autots_model(self):
        try:
            df = pd.read_excel(self.file_path)
            date_col = next((col for col in df.columns if col.lower() in ['datum', 'date', 'ds']), None)

            if date_col is None:
                raise ValueError("No valid date column found.")

            df[date_col] = pd.to_datetime(df[date_col])
            df_clean = df.dropna()

            self.final_forecast = pd.DataFrame()
            
            for col in df_clean.columns[1:]:
                model = AutoTS(
                    forecast_length=12,
                    frequency='infer',
                    prediction_interval=0.9,
                    ensemble='simple',
                    model_list="superfast",
                    transformer_list="superfast",
                    drop_most_recent=1,
                    validation_method='seasonal 168',
                    max_generations=5,
                    num_validations=2,
                    model_interrupt=True,
                    n_jobs='3',
                )

                model.fit(df_clean, date_col=date_col, value_col=col)

                forecast = model.predict()
                forecast_df = forecast.forecast.reset_index(drop=False)

                forecast_df.rename(columns={'index': 'Datum', 'forecast': col}, inplace=True)

                if self.final_forecast.empty:
                    self.final_forecast = forecast_df
                else:
                    self.final_forecast = self.final_forecast.merge(forecast_df, on='Datum', how='outer')

            # Code to display forecast...

        except Exception as e:
            logging.error("Error running AutoTSmodel: %s", str(e))
            messagebox.showerror("Error", f"Error running AutoTS model: {str(e)}")
    
    def save_forecast(self):
        # Code to save forecast...

if __name__ == "__main__":
    root = tk.Tk()
    app = App(root)
    root.mainloop()

What I’ve Tried:

  1. Ensured all dependencies are included: I’ve tried specifying hidden imports in the PyInstaller spec file for fbprophet and gluonts, but the issue persists.
  2. Checked for missing files: I’ve verified that all necessary files are bundled with the executable.

Questions:

  1. Are there any specific dependencies or files that need to be included when using PyInstaller with AutoTS?
  2. Could the issue be related to how PyInstaller handles the environment or the packages?
  3. Is there a way to debug or diagnose this issue more effectively?

Any guidance on resolving this would be greatly appreciated

New contributor

Philip Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật