I cant run my code in replit

I CANT RUN MY CODE IN REPLIT

I’m trying to run my python code with a tkinter graphical interface and when I enter information I want it to go to a spreadsheet on Google Drive. the code works perfectly using jupyter lab but here it gives an error about google sheets saying that the google sheets api version is not supported by replit. I already tried to install the new version through the console, I already tried to put it in the requirements. txt and I couldn’t. please help me because I want to run the code on a web page.

import os
import tkinter as tk
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from google.auth.transport.requests import Request


# If modifying these scopes, delete the file token.json.
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']

# The ID of the target spreadsheet.
SPREADSHEET_ID = 'XXXXXXXXX'
RANGE_NAME = 'Página1!A1'

class GoogleSheetsApp:
    def __init__(self, root):
        self.root = root
        self.root.title("GERÊNCIA")
        self.root.geometry("800x500")  # Set initial window size

        # Initialize Google Sheets
        self.initialize_google_sheets()

        self.create_main_interface()

    def initialize_google_sheets(self):
        creds = None

        if os.path.exists('token.json'):
            creds = Credentials.from_authorized_user_file('token.json', SCOPES)
        if not creds or not creds.valid:
            if creds and creds.expired and creds.refresh_token:
                creds.refresh(Request())
            else:
                flow = InstalledAppFlow.from_client_secrets_file(
                    'credentials.json', SCOPES)
                creds = flow.run_local_server(port=0)
            with open('token.json', 'w') as token:
                token.write(creds.to_json())

        self.service = build('sheets', 'v4', credentials=creds)

    def create_main_interface(self):
        self.name_label = tk.Label(self.root, text="Nome:")
        self.name_label.grid(row=0, column=0, sticky='w', padx=10, pady=5)

        self.name_entry = tk.Entry(self.root, width=60)
        self.name_entry.grid(row=0, column=1, sticky='w', padx=10, pady=5)

        self.send_data_button = tk.Button(self.root, text="Enviar Dados", command=self.send_data)
        self.send_data_button.grid(row=1, column=1, padx=10, pady=10, sticky='e')

    def send_data(self):
        name = self.name_entry.get()

        # Preparar os dados para envio
        values_to_add = [[name]]

        try:
            sheet = self.service.spreadsheets()
            result = sheet.values().append(
                spreadsheetId=SPREADSHEET_ID,
                range=RANGE_NAME,
                valueInputOption="USER_ENTERED",
                body={"values": values_to_add}
            ).execute()

            if result.get('updates', {}).get('updatedCells') > 0:
                tk.messagebox.showinfo("Sucesso", f"Dados '{name}' cadastrados com sucesso na planilha!")
            else:
                tk.messagebox.showwarning("Aviso", "Nenhum dado foi atualizado na planilha.")

            self.name_entry.delete(0, tk.END)  # Limpar o campo após o envio

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

if __name__ == '__main__':
    root = tk.Tk()
    app = GoogleSheetsApp(root)
    root.mainloop()

the error:

Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 226, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 226, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 226, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 226, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 227, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 227, in <module>
    app = GoogleSheetsApp(root)
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 28, in __init__
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 79, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 79, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 79, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 79, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
    app = GoogleSheetsApp(root)
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 23, in __init__
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
    app = GoogleSheetsApp(root)
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 23, in __init__
    self.initialize_google_sheets()
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 42, in initialize_google_sheets
    self.service = build('sheets', 'v4', credentials=creds)
  File "/home/runner/WorseTerribleLoaderprogram/.pythonlibs/lib/python3.10/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/runner/WorseTerribleLoaderprogram/.pythonlibs/lib/python3.10/site-packages/googleapiclient/discovery.py", line 287, in build
    content = _retrieve_discovery_doc(
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
 python3 main.py
Traceback (most recent call last):
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 81, in <module>
    app = GoogleSheetsApp(root)
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 23, in __init__
    self.initialize_google_sheets()
  File "/home/runner/WorseTerribleLoaderprogram/main.py", line 42, in initialize_google_sheets
    self.service = build('sheets', 'v4', credentials=creds)
  File "/home/runner/WorseTerribleLoaderprogram/.pythonlibs/lib/python3.10/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/runner/WorseTerribleLoaderprogram/.pythonlibs/lib/python3.10/site-packages/googleapiclient/discovery.py", line 287, in build
    content = _retrieve_discovery_doc(
  File "/home/runner/WorseTerribleLoaderprogram/.pythonlibs/lib/python3.10/site-packages/googleapiclient/discovery.py", line 404, in _retrieve_discovery_doc
    raise UnknownApiNameOrVersion(
googleapiclient.errors.UnknownApiNameOrVersion: name: sheets  version: v4