FileNotFoundError: [Errno 2] No such file or directory:

Claro, aqui está a versão em inglês do trecho:


I am using Prefect 2.0 to orchestrate some flows that access files stored in OneDrive. My project structure includes multiple Python files and uses relative paths to access these files.

When I run the flow, I encounter the following error in the terminal: FileNotFoundError: [Errno 2] No such file or directory: C:\Users\user\AppData\Local\Temp\tmp97ej3tz3prefect

created this flow to test:

import pandas as pd
import requests
import numpy as np
from datetime import timedelta
from sqlalchemy import over
import urllib3
import warnings
import os
from prefect import flow, task
from prefect.deployments import Deployment
from prefect.infrastructure.process import Process
from prefect.server.schemas.schedules import CronSchedule

warnings.filterwarnings('ignore')

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
warnings.simplefilter(action='ignore', category=FutureWarning)
pd.options.mode.chained_assignment = None

@task(name="Ler Credenciais", retries=5, retry_delay_seconds=120, log_prints=True)
def read_credentials():
    onedrive_folder = os.path.normpath(
        os.path.join(os.getcwd(), os.pardir, os.pardir, os.pardir, os.pardir)
    )
    print(r'{}'.format(os.getcwd()))

@flow(name="Teste de Acesso ao Arquivo Flow")
def test_access_file_flow():
    read_credentials()

if __name__ == "__main__":
    path = os.getcwd()
    os.chdir(path)

    process = Process(working_dir=path)
    deployment = Deployment.build_from_flow(
        flow=test_access_file_flow,
        name="Teste de Acesso ao Arquivo Flow",
        tags=['teste'],
        work_queue_name="default",
        infrastructure=process  
    )
    deployment.apply()

type or paste code here