Por que este código não funciona no Windows 8?

import tkinter as tk
from tkinter import filedialog, messagebox
import yfinance as yf
import pandas as pd

def browse_directory(directory_var):
    file_path = filedialog.askdirectory()
    if file_path:
        directory_var.set(file_path)

def open_window():
    root = tk.Tk()
    root.title("Inputs de Fetching")
    root.geometry("500x200")

    ticker_var = tk.StringVar()
    start_date_var = tk.StringVar()
    end_date_var = tk.StringVar()
    directory_var = tk.StringVar()

    ticker_label = tk.Label(root, text="Símbolo do ticker:")
    ticker_label.grid(row=0, column=0, padx=5, pady=5)
    ticker_entry = tk.Entry(root, textvariable=ticker_var)
    ticker_entry.grid(row=0, column=1, padx=5, pady=5)

    start_date_label = tk.Label(root, text="Data inicial (AAAA-MM-DD):")
    start_date_label.grid(row=1, column=0, padx=5, pady=5)
    start_date_entry = tk.Entry(root, textvariable=start_date_var)
    start_date_entry.grid(row=1, column=1, padx=5, pady=5)

    end_date_label = tk.Label(root, text="Data final (AAAA-MM-DD):")
    end_date_label.grid(row=2, column=0, padx=5, pady=5)
    end_date_entry = tk.Entry(root, textvariable=end_date_var)
    end_date_entry.grid(row=2, column=1, padx=5, pady=5)

    directory_label = tk.Label(root, text="Caminho do diretório:")
    directory_label.grid(row=3, column=0, padx=5, pady=5)
    directory_entry = tk.Entry(root, textvariable=directory_var)
    directory_entry.grid(row=3, column=1, padx=5, pady=5)
    directory_button = tk.Button(root, text="Selecionar diretório", command=lambda: browse_directory(directory_var))
    directory_button.grid(row=3, column=2, padx=5, pady=5)

    fetch_button = tk.Button(root, text="Buscar Dados", command=lambda: fetch_data(ticker_var.get(), start_date_var.get(), end_date_var.get(), directory_var.get()))
    fetch_button.grid(row=4, column=0, columnspan=2, padx=5, pady=10)

    root.mainloop()

def fetch_data(ticker, start_date, end_date, directory):
    if not ticker or not start_date or not end_date or not directory:
        messagebox.showerror("Erro", "Todos os campos devem ser preenchidos")
        return

    try:
        data = yf.download(ticker, start=start_date, end=end_date)
        csv_path = f"{directory}/{ticker}.csv"
        data.to_csv(csv_path)
        messagebox.showinfo("Sucesso", f"Dados salvos em: {csv_path}")

    except Exception as e:
        messagebox.showerror("Erro", str(e))

open_window()
