Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"azureml.core" incompatible with Python 3.10.5 #101397

Closed
civanescu opened this issue Nov 14, 2022 · 3 comments
Closed

"azureml.core" incompatible with Python 3.10.5 #101397

civanescu opened this issue Nov 14, 2022 · 3 comments

Comments

@civanescu
Copy link

civanescu commented Nov 14, 2022

Trying to follow machine learning training at https://learn.microsoft.com/en-us/training/modules/train-local-model-with-azure-mls/2-training-scripts found the following issue.

Python environment: Python 3.10.5
Package: azureml-core 1.0.23
Environment: Windows 11 Pro 10.0.22621 + Visual Studio Code 1.73.1 + Python extension v2022.18.2
Code section:

# Running the script as an experiment
from azureml.core import Experiment, ScriptRunConfig, Environment, Workspace 
[...]

Error result:

C:\Users\civan\VSCode\DP100> c:/Users/civan/VSCode/DP100/.venv/Scripts/python.exe 
Traceback (most recent call last):
  File "c:\Users\civan\VSCode\DP100\unitB21.py", line 2, in <module>
    from azureml.core import Experiment, ScriptRunConfig, Environment, Workspace
  File "C:\Users\civan\VSCode\DP100\.venv\lib\site-packages\azureml\core\__init__.py", line 10, in <module>
    from azureml.core.workspace import Workspace
  File "C:\Users\civan\VSCode\DP100\.venv\lib\site-packages\azureml\core\workspace.py", line 35, in <module>
    from azureml.data.datastore_client import _DatastoreClient
  File "C:\Users\civan\VSCode\DP100\.venv\lib\site-packages\azureml\data\datastore_client.py", line 19, in <module>
    from .azure_storage_datastore import AzureBlobDatastore, AzureFileDatastore
  File "C:\Users\civan\VSCode\DP100\.venv\lib\site-packages\azureml\data\azure_storage_datastore.py", line 14, in <module>
    from azureml._base_sdk_common.utils import create_retry, common_path, to_unix_path, accumulate
  File "C:\Users\civan\VSCode\DP100\.venv\lib\site-packages\azureml\_base_sdk_common\utils.py", line 10, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (C:\Python310\lib\collections\__init__.py)

Some latest python info related to "Iterable":
https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes
python/cpython#81505

@ManoharLakkoju-MSFT
Copy link
Contributor

@civanescu
Thanks for your feedback! We will investigate and update as appropriate.

It would be great if you could add a link to the documentation you are following for these steps? This would help us redirect the issue to the appropriate team. Thanks!

@civanescu
Copy link
Author

civanescu commented Nov 14, 2022

@ManoharLakkoju-MSFT , I don't understand the requirement. I tried to run the code from the training lesson. From python 3.10 it is obligatory to use from collection.abc import Iterable ... From error it appear: azureml\_base_sdk_common\utils.py", line 10, in <module> from collections import Iterable

In detail, the code from Azure Machine Learning DP-100 is. I just added Workspace in the 1st insert and I init a ws later in code, but I don't think that does matter.

from azureml.core import Experiment, ScriptRunConfig, Environment
from azureml.core.conda_dependencies import CondaDependencies

# Create a Python environment for the experiment
sklearn_env = Environment("sklearn-env")

# Ensure the required packages are installed
packages = CondaDependencies.create(conda_packages=['scikit-learn','pip'],
                                    pip_packages=['azureml-defaults'])
sklearn_env.python.conda_dependencies = packages

# Create a script config
script_config = ScriptRunConfig(source_directory='training_folder',
                                script='training.py',
                                environment=sklearn_env) 

# Submit the experiment
experiment = Experiment(workspace=ws, name='training-experiment')
run = experiment.submit(config=script_config)
run.wait_for_completion()

@ManoharLakkoju-MSFT
Copy link
Contributor

@civanescu
Thank you for your feedback!

Since this issue isn't directly related to improving our docs, and to gain a better understanding of your issue, I'd recommend working closer with our support team via an [Azure support request] (https://docs.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request). Or you can leverage our Q&A forum by posting your issue there so our community, and MVPs can further assist you in troubleshooting this issue or finding potential workarounds.

[Teams Q&A forum] (https://docs.microsoft.com/en-us/answers/topics/46488/office-teams-windows-itpro.html) for technical questions about the configuration and administration of Microsoft Teams on Windows.
[Microsoft Teams Community forum] (https://answers.microsoft.com/en-us/msteams/forum?sort=LastReplyDate&dir=Desc&tab=All&status=all&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&isFilterExpanded=false&page=1)
Thank you for your time and patience throughout this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants