错误消息嗨我正在做这个练习测试这个链接https://learn.microsoft.com/en-us/learn/modules/identify-faces-with-computer-vision/8-test-face-detection?pivots=python中给出的这个页面中的人脸检测API
当我在Python3.5.3 64位上执行中给出的命令时,我会收到一个错误,它说在这个版本中不支持from关键字。我已经尝试过Python3.7.4和3.8.6,在那里我也得到了同样的错误。
码
import os
from msrest.authentication import CognitiveServicesCredentials
from azure.cognitiveservices.vision.face import FaceClient错误消息
At line:2 char:1
+ from msrest.authentication import CognitiveServicesCredentials
+ ~~~~
The 'from' keyword is not supported in this version of the language.
At line:3 char:1
+ from azure.cognitiveservices.vision.face import FaceClient
+ ~~~~
The 'from' keyword is not supported in this version of the language.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ReservedKeywordNotAllowed请建议如何解决这个问题。
发布于 2020-12-01 09:00:31
似乎您正在为VSCode使用Python扩展。
因为它只是一个运行在PowerShell上的解释器,所以仍然需要在命令前面加上python才能工作,比如Visual代码中的python script.py。
https://stackoverflow.com/questions/65074075
复制相似问题