Why is an Azure Machine Learning tutorial notebook portion not running successfully?

Anonymous
2023-08-29T14:18:59.4766667+00:00

I started following along with the explore-data.ipynb notebook found under Samples > SDK v2 > tutorials > get-started-notebooks. At code cell [5] I am running into an error.

Here is the block of code:

import pandas as pd
 
# get a handle of the data asset and print the URI
data_asset = ml_client.data.get(name="credit-card", version=v1)
print(f"Data asset URI: {data_asset.path}")
 
# read into pandas - note that you will see 2 headers in your data frame - that is ok, for now
 
df = pd.read_csv(data_asset.path)
df.head()

The data asset path prints fine on line 5. However, the second-to-last line pd.read_csv(data_asset.path) raises an error (below):

RuntimeError: StreamError(PermissionDenied(Some(AuthenticationError("AttributeError: 'MLClient' object has no attribute '_base_url'"))))

The kernel is set to Python 3.10 - SDK V2.

Having followed the tutorial steps, I'm wondering whether something has changed (perhaps with read_csv) since the tutorial was released, if something about the workspace configuration needs to be adjusted for the code to run successfully, or if it's some other issue. What can be done?

Azure Machine Learning
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.