当我尝试使用 io.open 打开文件夹时出现文件夹权限错误
I am getting permission error to a folder when I try opening it with io.open
我正在尝试 运行 这篇 code 但我遇到了权限错误。你建议什么解决方案?我可以用其他东西替换 io.open
吗:
"""Detect labels given a file path."""
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.Feature.LABEL_DETECTION]
cwd = "E:/.../Google_Video_API/videos/"
with io.open(cwd, "rb") as movie:
input_content = movie.read()
operation = video_client.annotate_video(
request={"features": features, "input_content": input_content}
)
print("\nProcessing video for label annotations:")
这是我得到的错误:PermissionError: [Errno 13] Permission denied: 'E:/.../Google_Video_API/videos/'
有几个问题:
io.open
需要文件而不是目录; cwd
看起来是一个目录
cwd = "E:/.../Google_Video_API/videos/"
包括 ...
,对吗?
我正在尝试 运行 这篇 code 但我遇到了权限错误。你建议什么解决方案?我可以用其他东西替换 io.open
吗:
"""Detect labels given a file path."""
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.Feature.LABEL_DETECTION]
cwd = "E:/.../Google_Video_API/videos/"
with io.open(cwd, "rb") as movie:
input_content = movie.read()
operation = video_client.annotate_video(
request={"features": features, "input_content": input_content}
)
print("\nProcessing video for label annotations:")
这是我得到的错误:PermissionError: [Errno 13] Permission denied: 'E:/.../Google_Video_API/videos/'
有几个问题:
io.open
需要文件而不是目录;cwd
看起来是一个目录cwd = "E:/.../Google_Video_API/videos/"
包括...
,对吗?