AttributeError:'module'对象没有属性'youtube'

时间:2017-06-01 09:20:23

标签: python google-app-engine youtube-data-api gdata

我的python函数

def get_youtube_client():
    client = gdata.youtube.service.YouTubeService()
    client.client_id = "xxxxxxxx"
    client.developer_key = get_api_key()
    return client

我使用第三方销售将gdata引入libs文件夹。 enter image description here

执行get_youtube_client

时出现以下错误
INFO     2017-06-01 09:16:36,987 remote.py:24] Detected environment to be Google App Engine. Using synchronous HTTP transport.
WARNING  2017-06-01 19:16:37,144 urlfetch_stub.py:550] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
Exception on /Sermons/ZacPoonen [GET]
Traceback (most recent call last):
  File "lib\flask\app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "lib\flask\app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "lib\flask\app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "lib\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "lib\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Code\App-Engine\cfc-melbourne-website\app\sermons\routes\sermon_routes.py", line 89, in youtube_video
    Vp, videos = init_videos(author, queryterm, url)
  File "C:\Code\App-Engine\cfc-melbourne-website\app\sermons\models\video.py", line 136, in init_videos
    client = get_youtube_client()
  File "C:\Code\App-Engine\cfc-melbourne-website\app\sermons\models\video.py", line 150, in get_youtube_client
    client = gdata.youtube.service.YouTubeService()
AttributeError: 'module' object has no attribute 'youtube'

更新了gdata文件夹的图像

enter image description here

0 个答案:

没有答案