Hello everyone, what could be the problem? ```Fail...
# ask-community
s
Hello everyone, what could be the problem?
Copy code
Failed to load and execute Flow's environment: StorageError('An error occurred while unpickling the flow:\n AttributeError("Can\'t get attribute \'_unpickle_timestamp\' on <module \'pandas._libs.tslibs.timestamps\' from \'/usr/local/lib/python3.7/site-packages/pandas/_libs/tslibs/timestamps.cpython-37m-x86_64-linux-gnu.so\'>")\nThis may be due to one of the following version mismatches between the flow build and execution environments:\n - prefect: (flow built with \'0.15.3\', currently running with \'0.14.19\')\n - python: (flow built with \'3.7.3\', currently running with \'3.7.4\')')
Is it that I have a version older than on the server?
a
@Sergey the problem here is that you registered the flow with: • Python 3.7.3 • Prefect 0.15.3 During the registration, flow object got serialized to work with those specific versions. But now you are running it with different versions on your agent: • Python 3.7.4 • Prefect 0.14.9 To solve this, you can either: 1. Reregister the flow with the same version as the agent, 2. Modify the agent to use the same version as your registration environment 3. Or you can switch to script storage instead of pickle storage to mitigate such issues: https://docs.prefect.io/orchestration/flow_config/storage.html#pickle-vs-script-based-storage
s
@Anna Geller but how to re-register it?
a
You can either add flow.register() to your flow:
Copy code
if __name__ == '__main__':
    flow.register("project_name")
or use CLI:
Copy code
prefect register --project your-project -p /path/to/flow.py
s
@Anna Geller I changed the prefect version to 0.14.9 on the local machine by pushing to the server, but it still gives the same error
a
and the Python version?
how do you define flow storage? maybe it makes sense to use script storage in this case: https://docs.prefect.io/orchestration/flow_config/storage.html#pickle-vs-script-based-storage
s
@Anna Geller I can't change the python version
a
sure, no problem. Can you then create a virtual environment on your machine with the same versions as your agent? • Python 3.7.4 • Prefect 0.14.9 You can do it e.g. with conda:
Copy code
conda create --name prefectVenv python=3.7.4
pip install prefect==0.14.9
prefect register --project your-project -p /path/to/flow.py
s
@Anna Geller I made a virtual environment through virtualenv, re-created the file with the code and sent it to the server, but the error is still the same
a
@Sergey 1. Do you run on Prefect Cloud or Server? If Server, what is your Prefect version on Server? 2. How do you define storage in your flow?
s
@Anna Geller 1.
0.14.19
2.
we do not explicitly define the storage
Copy code
with Flow("example") as flow:
    pass
I can attach a code
a
Thanks for answering. The problem currently is that your Server version is lower than your flow version. Prefect Server version must be higher or equal to the flow’s Prefect version. So you would either have to upgrade your Server or downgrade the Prefect version in the environment from which you register your flows. Since you don’t explicitly define your storage, I assume you run it with a local agent and you use the default local storage? https://docs.prefect.io/orchestration/flow_config/storage.html#local
s
@Anna Geller but I have another flow working fine
a
This shows your agent version, not the Server. What’s your Prefect Server version? Or maybe do you use Prefect Cloud? How do you register your flow? You can either: 1. Define storage explicitly: https://docs.prefect.io/orchestration/flow_config/storage.html#local  2. Or use prefect CLI to register instead of flow.register() - CLI will use script storage by default which can likely fix your issue: https://docs.prefect.io/api/latest/cli/register.html