https://prefect.io logo
Title
j

Jelle Vegter

01/06/2023, 2:27 PM
Hi all, I’m trying to run Pytest for a Prefect project in a docker container. Pytest works locally (using Poetry to create virtual environment) but I’m running into a ModuleNotFoundError for prefect.logging when executing pytest on the docker image. My Prefect version is 2.7.6. Any idea’s why this would happen?
I use Azure as storage btw
Also importing as from prefect.logging.loggers import disable_run_logger fails for the same reason: ModuleNotFoundError: No module named ‘prefect.logging’
This is from within the container
pytest throws ModuleNotFoundError: No module named ‘prefect.logging’ but python recognises the package
c

Christopher Boyd

01/09/2023, 2:56 PM
What is the path for prefect.logging - it could be either a) that it’s not installed into the docker container you are running, or if it is, it’s not in the same path
in your PYTHONPATH usually