PrefectHQ / prefect

Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
https://prefect.io
Apache License 2.0
15.29k stars 1.5k forks source link

Prefect-gitlab "No module named distutils" #14068

Closed GuilleAmutio closed 1 week ago

GuilleAmutio commented 1 week ago

First check

Bug summary

Hello,

When running a Prefect flow i get the error ModuleNotFoundError: no module named 'distutils' coming from the prefect_gitlab.GitLabCrdentials function.

I have seen that the 3.0.0rc2 gets rid of this dependency but would like to ask if its plan for v2.

Reproduction

gitlab_credentials = prefect_gitlab.GitLabCredentials(
     token=args.access_token, url=args.gitlab_url
)

Error

2024-06-17T08:27:06.299Z | python version: Python 3.12.3
2024-06-17T08:27:10.164Z | prefect version: 2.19.4
2024-06-17T08:27:16.124Z | Traceback (most recent call last):
2024-06-17T08:27:16.124Z |   File "<string>", line 1, in <module>
2024-06-17T08:27:16.124Z |   File "/opt/prefect/.venv/lib/python3.12/site-packages/prefect_gitlab/init.py", line 3, in <module>
2024-06-17T08:27:16.124Z |     from .repositories import GitLabRepository
2024-06-17T08:27:16.124Z |   File "/opt/prefect/.venv/lib/python3.12/site-packages/prefect_gitlab/repositories.py", line 45, in <module>
2024-06-17T08:27:16.124Z |     from distutils.dir_util import copy_tree
2024-06-17T08:27:16.124Z | ModuleNotFoundError: No module named 'distutils'

Versions

prefect==2.19.4
prefect_gitlab==0.2.5
python==3.12.3

Additional context

No response

ldcorentin commented 1 week ago

Same issue here...

jakekaplan commented 1 week ago

Hi thanks for filing this issue! disutils from the stdlib was deprecated in python3.10 and removed in python3.12. Unfortunately prefect-gitlab==0.2.5 does not support python3.12.

You could either use a lower python version or upgrade prefect-gitlab to it's current pre-release which does work with python3.12. At this time we are unlikely to release another 2.x version of that package.