https://prefect.io logo
Title
k

Ken Nguyen

12/28/2022, 7:53 PM
Hi! I recently had a working config of my Prefect 1 flow by importing the following modules:
import prefect
from prefect import task, Flow
from prefect.storage import GitHub
from prefect.run_configs import ECSRun
from prefect.client import Secret
However, when I run my code now (Prefect 2.7.4), I get a
ModuleNotFoundError: No module named 'prefect.storage'
error (same goes for
prefect.run_configs
and
prefect.client
). Was there a recent update to the way we should import these modules?
I believe prefect is installed correctly since I’m able to check for the prefect version in my virtualenv, and there are also no errors with the lines:
import prefect
from prefect import task, Flow
z

Zanie

12/28/2022, 7:55 PM
Hi! We’ve made some significant breaking changes from v1 -> v2
👀 1
You’ll probably want to stay on Prefect v1 and upgrade intentionally after you’ve had a chance to look at the v2 documentation at docs.prefect.io
k

Ken Nguyen

12/28/2022, 7:57 PM
I see! We have a planned migration for Q1 2023, but if I wanted to stick with Prefect 1 for now, are there any resources on how to import these Prefect 1 modules correctly?
z

Zanie

12/28/2022, 7:58 PM
You’ll just want to install the latest Prefect 1 version e.g.
pip install prefect<2.0
k

Ken Nguyen

12/28/2022, 8:02 PM
Oh yes of course, thank you for your help!