jolly-florist-66728
09/10/2024, 10:16 AMTraceback (most recent call last):
File "/opt/micromamba/envs/runtime/lib/python3.10/site-packages/flytekit/exceptions/scopes.py", line 242, in user_entry_point
return wrapped(*args, **kwargs)
File "/root/sat_stac.py", line 35, in parse_geojson
from pystac_client import Client
Message:
ModuleNotFoundError: No module named 'pystac_client'
User error.
# Answer
The error ModuleNotFoundError: No module named 'pystac_client' suggests that the pystac_client module is not found in the environment where the task is being executed. This could be due to several reasons, such as the Docker image not being used correctly or the module not being installed properly in the Docker image.
1. Verify Docker Image: Ensure that the Docker image you pushed to the GCP artifact repository indeed contains the pystac_client module. You can do this by running a container from the image and checking if the module is available.
2. Check Task Definition: Ensure that the container_image parameter in the @task decorator is correctly pointing to the Docker image in the GCP artifact repository.
Example:
@task(container_image="gcr.io/your-project-id/your-image:tag")
def parse_geojson():
from pystac_client import Client
# Your task logic here
3. Rebuild and Push Docker Image: If the module is not found, rebuild the Docker image ensuring that pystac_client is included in the requirements.txt or installed in the Dockerfile, and push it again to the GCP artifact repository.
Would you like more detailed steps or further assistance?
Sources:
- Flyte Discussion on ModuleNotFoundError
- Flyte GitHub Issue on Module Import
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1725963405.724669 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.