were there recent changes involving prefect, pipen...
# ask-community
j
were there recent changes involving prefect, pipenv and deployments? Suddenly getting errors
ModuleNotFoundError: No module named 'prefect.deployments'
despite not updating the prefect version at all
👀 1
b
Hi John, thanks for raising. Would you mind sharing the stack trace for the error?
and if you wouldn't mind, the version of Prefect you're currently using?
upvote 1
j
Copy code
raceback (most recent call last):
  File "/usr/local/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/local/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/workspaces/ingestion-pipeline/tests/validation/touchstone/test_sql_rules.py", line 1, in <module>
    from src.validation.touchstone import (
  File "/workspaces/ingestion-pipeline/src/validation/touchstone.py", line 16, in <module>
    from src.validation.common import (
  File "/workspaces/ingestion-pipeline/src/validation/common.py", line 13, in <module>
    from src.transform.aws import download_file
  File "/workspaces/ingestion-pipeline/src/transform/aws.py", line 9, in <module>
    from src.transform.common import Persistable, unzip_file, zip_up
  File "/workspaces/ingestion-pipeline/src/transform/common.py", line 10, in <module>
    from prefect.deployments import run_deployment
ModuleNotFoundError: No module named 'prefect.deployments'
prefect version "~=2.11.0" started working again randomly yesterday but now it's not longer working today
b
Hmm, it sounds like something is happening in the execution environment where
prefect.deployments
randomly ends up missing. > started working again randomly yesterday maybe something is happening with the image that's being used, potentially?
How are you executing the flows? As ECS tasks?
j
Yeah our flows are executed as ECS tasks. Also to be specific these errors are occurring while trying to import test modules as a part of vs code test discovery
b
Thanks for the context. How are are you importing the test modules? Are you using a prefect.yaml to install extra dependencies by chance?
j
we use pipenv to build the test environment. So prefect would be defined as "~=2.11.0" in our pipfile