https://prefect.io logo
i

Izz

09/14/2023, 12:26 PM
Hey hey! I have this small flow I want to try and deploy
Copy code
@flow(name="LO", flow_run_name="test-LO")
def live_odds_poc():
    logger = get_run_logger()
    <http://logger.info|logger.info>("Starting LO poc flow")

    flow = LiveOdds()
    lo_result = flow.run_flow()
and I’m doing running this
Copy code
if __name__ == "__main__":
    live_odds_poc.serve(
        name="LO-test",
        tags=["LO"],
        interval=15
    )
but when I run it I get this Attribute Error ->
AttributeError: 'Flow' object has no attribute 'serve'
I have followed the tutorial in Prefect Cloud and I don’t see anything wrong (I also copied the code from the tutorial and got the same error). Can you help me? 🙏
1
j

Jeff Hale

09/14/2023, 12:41 PM
What does running
prefect version
in the terminal output?
i

Izz

09/14/2023, 12:49 PM
Copy code
Version:             2.11.5
API version:         0.8.4
Python version:      3.9.13
Git commit:          a597971f
Built:               Thu, Aug 24, 2023 2:14 PM
OS/Arch:             darwin/x86_64
Profile:             default
Server type:         cloud
j

Jeff Hale

09/14/2023, 12:54 PM
Ah. I think that’s the issue. Do a
pip install -U prefect
and you’ll get version 2.13.0, which has that method in it. 🙂
i

Izz

09/14/2023, 1:00 PM
that worked! thanks so much!
🙌 3
j

Jeff Hale

09/14/2023, 1:00 PM
Great!