skip to Main Content

I’ve installed python 3.8, from vscode terminal I created an env and seem to have successfully installed azureml as below:

C:Python38python.exe -m venv tempml
tempmlscriptsactivate
pip install azureml-core

I then go into python and type

import azureml

but I get the following error:
ModuleNotFoundError: No module named ‘azureml’

if i go back to terminal and type

pip show azureml-core

i can indeed see it:

Name: azureml-core
Version: 1.53.0
Summary: Azure Machine Learning core packages, modules, and classes
Home-page: https://docs.microsoft.com/python/api/overview/azure/ml/?view=azure-ml-py
Author: Microsoft Corp
Author-email: None
License: https://aka.ms/azureml-sdk-license
Location: c:python38tempmllibsite-packages
Requires: docker, msal, azure-common, paramiko, msrestazure, azure-mgmt-resource, msrest, PyJWT, azure-graphrbac, azure-core, ndg-httpsclient, contextlib2, jmespath, backports.tempfile, adal, argcomplete, urllib3, azure-mgmt-network, cryptography, knack, pkginfo, python-dateutil, jsonpickle, azure-mgmt-keyvault, azure-mgmt-containerregistry, azure-mgmt-storage, humanfriendly, azure-mgmt-authorization, pathspec, pytz, msal-extensions, requests, pyopenssl, packaging, SecretStorage
Required-by:

if someone could please help it would be much appreciated. Thank you

2

Answers


  1. Chosen as BEST ANSWER

    I found the absolute path and then added it using sys:

    pip show azureml-core
    

    then in python:

    import sys
    sys.path.append("c:/python38/tempml/lib/site-packages/")
    

    and this now works


  2. You need to make sure you are using an interpreter with the azureml module installed. It appears in the lower right corner, click on it to switch interpreters, choosing the correct one.

    enter image description here

    Also make sure to execute the script using the python extension

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search