https://prefect.io logo
j

Josh

05/23/2022, 8:59 PM
I can’t find an environment variable in my flow run. The error includes a message
This may be due to one of the following version mismatches between the flow build and execution environments:\n - python: (flow built with '3.7.13', currently running with '3.7.12')")
The CI/CD system registering my flow I guess is using python 3.7.13. But how do I know what the execution environment python is if it’s executing from a docker image in a prefect docker agent?
k

Kevin Kho

05/23/2022, 9:01 PM
You can exec into the base image and check I think? I actually suspect this is a
cloudpickle
version issue more than python version. So check Prefect and cloudpickle versions
j

Josh

05/23/2022, 9:04 PM
Yeah the logs do also mention the error occurred while unpickling the flow
How do I check the
cloudpickle
version?
the base image’s python version is 3.7.12
k

Kevin Kho

05/23/2022, 9:07 PM
Maybe
pip show cloudpickle
inside the base image?
j

Josh

05/23/2022, 9:07 PM
Copy code
pip show cloudpickle
Name: cloudpickle
Version: 1.6.0
Summary: Extended pickling support for Python objects
Home-page: <https://github.com/cloudpipe/cloudpickle>
Author: Cloudpipe
Author-email: <mailto:cloudpipe@googlegroups.com|cloudpipe@googlegroups.com>
License: BSD 3-Clause License
Location: /usr/local/lib/python3.7/site-packages
Requires:
Required-by: dask, distributed, gym, mlflow, prefect, shap
that’s a version from August 25, 2020. there’s since been a 2.0.0 release and a 2.1.0 release. Would that cause an issue?
k

Kevin Kho

05/23/2022, 9:08 PM
It would if your registration was on the 2.0 or 2.1
j

Josh

05/23/2022, 9:09 PM
I guess that is theoretically possible, but I’m pinning my dependencies, so I did not think that would happen
k

Kevin Kho

05/23/2022, 9:10 PM
How about agent cloudpickle version?
j

Josh

05/23/2022, 9:13 PM
how do I check the agent cloudpickle version?
k

Kevin Kho

05/23/2022, 9:14 PM
Same thing in the same box/environment as the agent.
pip show cloudpickle
j

Josh

05/23/2022, 9:14 PM
you mean on the host?
k

Kevin Kho

05/23/2022, 9:15 PM
Yes!
j

Josh

05/23/2022, 9:17 PM
ah I’m running python 3.8 on the host where the prefect agent is running. and
pip show cloudpickle
on the VM/host showed 2.0.0
I’ll try installing 1.6.0 on the box and rerunning
still the same issue. Would i have to install python 3.7.12 on the host?
k

Kevin Kho

05/23/2022, 9:19 PM
Normally within the minor version is ok so i’d be surprised but it’s worth trying.
j

Josh

05/23/2022, 9:23 PM
ah was cloudpickle + user error on path of what was in the image vs on host
thanks for helping!
k

Kevin Kho

05/23/2022, 9:25 PM
Ah ok. Nice!
2 Views