Azure / Azure/azure-sdk-for-python

mltable / Azureml Dataprep seems to be still dependent on pkg_resources and thus is broken with python 3.12

Open
#38,915 8 comments 1 reaction 1 assignee Claimed by @vivram View on GitHub
Client customer-reported dataprep Machine Learning needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: mltable / azureml dataprep
- **Package Version**: 1.6.1
- **Operating System**: Linux
- **Python Version**: 3.12.8

**Describe the bug**

Hi,
I was glad to see that azureml now should be supporting 3.12, but it seems like not all my azureml dependencies truely support 3.12 yet.

What it seems like is that azureml dataprep still is dependent on pkg_resources, and azureml dataprep is a dependency for mltable:

```
ImportError while importing test module '/home/vsts/work/1/s/tests/ourtest.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ourcodepathhere.py:4: in
import mltable
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/mltable/__init__.py:11: in
from .mltable import MLTable, load, from_delimited_files, from_parquet_files, from_json_lines_files, from_paths, \
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/mltable/mltable.py:19: in
from azureml.dataprep.api._loggerfactory import track, _LoggerFactory, trace
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/azureml/dataprep/api/_loggerfactory.py:8: in
import pkg_resources
E ModuleNotFoundError: No module named 'pkg_resources'

```

pip freeze slimmed down to relevant packages:

```
azure-ai-ml==1.23.0
azure-common==1.1.28
azure-core==1.32.0
azure-cosmos==4.9.0
azure-identity==1.19.0
azure-keyvault-secrets==4.9.0
azure-mgmt-core==1.5.0
azure-storage-blob==12.19.0
azure-storage-file-datalake==12.14.0
azure-storage-file-share==12.20.0
azureml-dataprep==5.1.6
azureml-dataprep-native==41.0.0
azureml-dataprep-rslex==2.22.5
azureml-fsspec==1.3.1
azureml-mlflow==1.58.0
mltable==1.6.1
opencensus==0.11.4
opencensus-context==0.1.3
opencensus-ext-azure==1.1.13
opencensus-ext-logging==0.1.1
```

Hope we can sort this out!

**To Reproduce**
As above using or importing mltable results into this dependency still relying on pkg_resources, which is deprecated in python 3.12.

**Expected behavior**
I expected for python 3.12 to be compatible as stated in azure ml package documentation.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.