I'm not sure what the issue is but
check image below for error and code posted for easy copy pasta
from prefect import flow, task
import httpx
@task(retries=3)
def get_stars(repo):
url = f"https://api.github.com/repos/{repo}"
count = httpx.get(url).json()["stargazers_count"]
print(f"{repo} has {count} stars!")
@flow
def github_stars(repos):
for repo in repos:
get_stars(repo)
# call the flow!
github_stars(["PrefectHQ/Prefect", "PrefectHQ/prefect-aws", "PrefectHQ/prefect-dbt"])
Edit: Found the solution:
I can see that you have not activated your virtualenv that might be the issue, you need to first install virtualenv.
Using this you can install virtualenv in your system:
pip install virtualenv
then you have to create a virtual environment, you can do that by following command.
python -m virtualenv myEnv # ---> whatever name you want here
and then you have to activate the environment by following command:
myEnv\Scripts\activate
and to deactivate, simply use:
deactivate