简体   繁体   中英

ModuleNotFoundError: No module named 'azure.cognitiveservices'

I will say up front I'm new to python and I'm moving from using a Notebook in Azure (within a lab) toward trying to get this to work on my home system. I'm getting this error when running the following line of code:

from azure.cognitiveservices.vision.computervision import ComputerVisionClient <-------------


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'azure.cognitiveservices'
  
>>> import sys
>>> sys.path
['', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\python37.zip', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\DLLs', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib\\site-packages']

>>> os.getcwd()
'C:\\Users\\david\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages'
>>>

C:\Python>python -m pip freeze
azure-cognitiveservices-vision-computervision==0.7.0
azure-common==1.1.26
certifi==2020.12.5
chardet==4.0.0
idna==2.10
isodate==0.6.0
msrest==0.6.20
oauthlib==3.1.0
Pillow==8.1.0
requests==2.25.1
requests-oauthlib==1.3.0
six==1.15.0
urllib3==1.26.3

I have searched for a solution to this but the solutions I have found don't seem to apply. If someone could explain a solution that is more descriptive I would really appreciate it.

Run the line below, then it will work fine.

pip install azure-cognitiveservices-vision-computervision

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM