I am doing AML tutorial in 03.auto-train-models.ipynb.
As a very new user, I get stuck from the beginning.
From Prerequisites
I am creating a workspace and its configuration file (config.json)
I create python code and run in Azure ML workbench as below: (xxx is hidden info)
from azureml.core import Workspace
subscription_id ='xxxxxxx-xxxx-xxxx-bf6a-e03e4fe8bced'
resource_group ='xxxxxxx-AZURE-DEV'
workspace_name = 'xxxxxx-test-AML'
try:
ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)
ws.write_config()
print('Library configuration succeeded')
except:
print('Workspace not found')
After I run the script, there is an error below:
File "config.py", line 1, in
from azureml.core import Workspace
ImportError: No module named 'azureml.core'
Could you help me what did I do wrong?
It seem that azureml library is not connected.
by the way, I have installed azureml and confirm with pip freeze. (azureml==0.2.7)
conda version : 4.5.11
python version : 3.6.5.final.0
platform : win-64
Hello, do you have the azureml-train-automl package installed? It's needed for 03.auto-train-models.ipynb and will also pull in the azureml.core package as a dependency.
Hi, wchill
Many thanks for your answer.
I have tried installing azureml-train-automl package.
I have checked my package with pip freeze. This package show up [azureml-core==0.1.65] .
Is it the one I need?
By the way, I have run above python script again.
This error is still shown up.
File "config.py", line 1, in
from azureml.core import Workspace
ImportError: No module named 'azureml.core'
PS. I feel I am get closer to solution.
Do you think it is due to python version or conflicting library?
It seems there are some conflicting with Tensorflow package.
Yes, that is the correct package.
Just to verify, can you run pip install --upgrade azureml-sdk[notebooks,automl]? This should install all SDK packages and if it doesn't then we do have a problem.
Your Python version is fine. We do have Tensorflow locked down to version 1.10.0 for azureml-train-automl; maybe that's what's causing the conflict? Do you have any other packages installed in that environment that are taking a dependency on Tensorflow?
One more thing, it seems like you are using AzureML Workbench, can you try using the conda environment directly (in a command prompt)? This will help us identify where the issue is if there is one.
The new AzureML Python SDK and old AzureML Workbench are incompatible. To use the azureml-sdk, the recommended approach is to create a conda environment, or python virtual environment to ensure a clean installation with no dependency conflicts, or packages shadowing each other.
See here for documentation: https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-configure-environment
Thank you wchill and rastala for very helpful answers.
I have set up a virtual environment to avoid conflicts.
I have passed the step and confirm my workspace account.
SOLUTION: set up virtual python environment
Yet, I got stuck with another check point which I may put in separated issue if I cannot get over it.
For reference:
When I install azureml-train-automl in old environment.
pip install azureml-train-automl
There are few error line during installation.
tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.15.1 which is incompatible.
Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Closes #38
Most helpful comment
The new AzureML Python SDK and old AzureML Workbench are incompatible. To use the azureml-sdk, the recommended approach is to create a conda environment, or python virtual environment to ensure a clean installation with no dependency conflicts, or packages shadowing each other.
See here for documentation: https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-configure-environment