-1

I'm starting to leart some prefect + python and I'm facing a strange error at the very beginning with a very easy script:

Image of the code

I have already tried it in two diferents PC.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • 2
    Welcome to the site. [Please do not post pictures of your code.](//meta.stackoverflow.com/q/285551) – khelwood Jan 13 '23 at 10:15

2 Answers2

8

It looks like you've installed Prefect 2, but are following instructions for Prefect 1.

I recommend starting with the first steps tutorial in the Prefect docs: https://docs.prefect.io/tutorials/first-steps/

RPeden
  • 341
  • 1
  • 4
  • Many Thanks, thats exactly what happend, I thought that there would'nt be many diferences between 1 and 2. How can I select your answer as solution? – Taras Synenkyy Jan 13 '23 at 10:45
0

the way with statements work is that the variable you're defining only exists within the indented code block underneath the with statement itself. The end of your code should be:

with Flow("prueba 1") as flow:
    carga()
    flow.run()
Matthew Miles
  • 727
  • 12
  • 26
  • HI Matthew, thanks for your answer but I have tried your code and its still not working. Actually the script I writed its from a udemy's course, and of course its working for the course's guy. – Taras Synenkyy Jan 13 '23 at 10:31