Error encountered while using the YouTube Data API

61 views
Skip to first unread message

Rohan Saxena

unread,
Feb 17, 2016, 10:58:18 AM2/17/16
to Google API Python Client
Hi all,
I am very new to both Python and Google APIs, so forgive me if my query is basic. I have been struggling with it for days now.
I want to get all top-level comments from a YouTube video. For this I am using the YouTube Data API. I have also created a server API developer key from Google Developers. I call the build() method as mentioned in the docs, to create a youtube data api service object:

from apiclient.discovery import build
youtube = build('youtube', 'v3', developerKey='my_developer_key')

However, I get the following error:
WARNING:root:No module named locked_file
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery_cache/__init__.py", line 38, in autodetect
    from . import file_cache
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery_cache/file_cache.py", line 32, in <module>
ImportError: No module named locked_file


Why is this problem coming and how do I solve it?

Thanks in advance,
Rohan Saxena.

Nathaniel Manista

unread,
Feb 17, 2016, 1:19:23 PM2/17/16
to google-api-p...@googlegroups.com
It's happening because a new oauth2client version was released this week in which the locked_file module was moved. A fix for google-api-python-client is in the works. In the meantime you could try pinning your oauth2client dependency to 1.5.2?
-Nathaniel

Rohan Saxena

unread,
Feb 18, 2016, 12:25:37 AM2/18/16
to Google API Python Client
Thanks for that update, I did not know about that. However, I am not using oauth2 for authentication, I am using a server API key. Does this update still affect me? Also, could you please explain in little more detail what you asked me to do? I did not quite understand it.
-Rohan
Reply all
Reply to author
Forward
0 new messages