https://prefect.io logo
Title
y

YSF

03/09/2023, 7:46 PM
Sorry put this in the wrong channel: Hi all, I think I'm doing something simple and mistaken. I'm using Python 3.9.6 on Windows 10, and Prefect version 2.8.4, I have the simplest code in a file called dev.py from the 1st tutorial example from the site. I'm using a Python venv too
from prefect import flow

@flow
def my_favorite_function():
    print("What is your favorite number?")
    return 42

print(my_favorite_function())
And when I run
python dev.py
it gives me an error
RuntimeError: Cannot create flow run. Failed to reach API at <http://127.0.0.1:4200/api/>
I tried changing the code to:
from prefect import flow

@flow
def my_favorite_function():
    print("What is your favorite number?")
    return 42

if __name__ == "__main__":
    print(my_favorite_function())
And it still gives me the same error. Am I missing something? I'm sure I've run this code before when trying to learn (edited)