Hi.. I got this error `ValueError: A `path` must b...
# prefect-community
w
Hi.. I got this error `ValueError: A
path
must be provided to show where flow
.py
file is stored.` My flow code like this!
Copy code
with Flow('flow_step1', storage=Local()) as flow:
    engine = create_engine('<mysql+pymysql://wonsun.jeong>:~~~~~~~~~~~~~~~', echo=True)
    connection = engine.connect()
    
    before = check_db()
    after = check_storage()
    
    answer = coin_inspection(after, before)
    
    with case(answer, False):
        new_datas = action_if_false()
        raw_extract = each_file_info.map(new_datas)
        final = each_ecg_meta.map(raw_extract)
        
    with case(answer, True):
        action_if_true()
           

flow.storage = Local(stored_as_script=True)
flow.register(project_name='try')
flow.run() 
# flow.visualize()
This python file name is 'flow_step1.py'. What's the problem?? Also, most weird thing is window(local) already run 'flow_step1' and create result files but prefect web UI can't detect this flow! I'm so confused because i don't understand exactly Flow, Register, Agent, Server, Local, Path.. in Prefect. Help me please.. 🤯
k
If using
stored_as_script=True
, you need to point to where the file lives with
path
.
Copy code
flow.storage=Local(path=...,stored_as_script=True
❤️ 1
w
The file you mentioned is the python code for define flow? In this case write this.
flow.storage=Local(path='C:\\Users\\user\\.prefect',stored_as_script=True)
Right?
k
Yep the doc string will have more detail
w
Thanks Kevin! Don't panic..😂
🙌 1