PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
16.27k stars 1.58k forks source link

ModuleNotFoundError: No module named 'exceptiongroup' #14870

Closed alexbakewell closed 2 months ago

alexbakewell commented 2 months ago

Bug summary

All flows we are running since 2.20.0 are giving the following error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\resources\.venv\Scripts\glue-scripts.exe\__main__.py", line 4, in <module>
  File "C:\resources\.venv\Lib\site-packages\glue_scripts\cli\main.py", line 11, in <module>
    from glue_scripts.cli import aws_client_api, image_management, test_controller
  File "C:\resources\.venv\Lib\site-packages\glue_scripts\cli\aws_client_api.py", line 10, in <module>
    from prefect.exceptions import FlowRunWaitTimeout, ObjectNotFound
  File "C:\resources\.venv\Lib\site-packages\prefect\__init__.py", line 30, in <module>
    from prefect.deployments import deploy
  File "C:\resources\.venv\Lib\site-packages\prefect\deployments\__init__.py", line 2, in <module>
    import prefect.deployments.steps
  File "C:\resources\.venv\Lib\site-packages\prefect\deployments\steps\__init__.py", line 2, in <module>
    from .pull import (
  File "C:\resources\.venv\Lib\site-packages\prefect\deployments\steps\pull.py", line 11, in <module>
    from prefect.runner.storage import BlockStorageAdapter, GitRepository, RemoteStorage
  File "C:\resources\.venv\Lib\site-packages\prefect\runner\__init__.py", line 1, in <module>
    from .runner import Runner
  File "C:\resources\.venv\Lib\site-packages\prefect\runner\runner.py", line 99, in <module>
    from prefect.utilities.engine import propose_state
  File "C:\resources\.venv\Lib\site-packages\prefect\utilities\engine.py", line 23, in <module>
    from exceptiongroup import BaseExceptionGroup  # novermin
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'exceptiongroup'

Version info (prefect version output)

Version:             2.20.0
API version:         0.8.4
Python version:      3.12.3
Git commit:          15274df8
Built:               Thu, Aug 1, 2024 3:14 PM
OS/Arch:             linux/x86_64
Profile:             default
Server type:         server

Additional context

We are still able to run fine on 2.19.0, this only happens with 2.20.0

desertaxle commented 2 months ago

Thanks for the issue @alexbakewell! It looks like the exceptiongroup package is included in requirements.txt but not in requirements-client.txt. Are you using the prefect-client package by any chance? If you are, I think we can fix this by moving the exceptiongroup dependency to the correct requirements file. I'll create a PR and tag you if you'd like to verify the fix.

alexbakewell commented 2 months ago

Hi, yes we are using the prefect-client package, thanks

desertaxle commented 2 months ago

Leaving some details in case other users run into this issue:

desertaxle commented 2 months ago

The fix for this has been released in the 2.20.1 version of prefect-client! I'm closing this issue as resolved, but please leave a comment or open a new issue if you run into errors with the new version.