{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-python-client/issues/128","labels_url":"https://api.github.com/repos/google/google-api-python-client/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-python-client/issues/128/comments","events_url":"https://api.github.com/repos/google/google-api-python-client/issues/128/events","html_url":"https://github.com/google/google-api-python-client/issues/128","id":104760107,"number":128,"title":"discovery_cache module not packaged during installation.","user":{"login":"sergey-ob","id":4041590,"avatar_url":"https://avatars.githubusercontent.com/u/4041590?v=3","gravatar_id":"","url":"https://api.github.com/users/sergey-ob","html_url":"https://github.com/sergey-ob","followers_url":"https://api.github.com/users/sergey-ob/followers","following_url":"https://api.github.com/users/sergey-ob/following{/other_user}","gists_url":"https://api.github.com/users/sergey-ob/gists{/gist_id}","starred_url":"https://api.github.com/users/sergey-ob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergey-ob/subscriptions","organizations_url":"https://api.github.com/users/sergey-ob/orgs","repos_url":"https://api.github.com/users/sergey-ob/repos","events_url":"https://api.github.com/users/sergey-ob/events{/privacy}","received_events_url":"https://api.github.com/users/sergey-ob/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-03T18:59:26Z","updated_at":"2015-09-03T21:34:23Z","closed_at":"2015-09-03T20:47:22Z","body":"I've installed `google-api-python-client` from source, but when at some point my application was failing with this message:\r\n\r\n```\r\n  ...\r\n  ...\r\n  File \"build/bdist.linux-x86_64/egg/oauth2client/util.py\", line 142, in positional_wrapper\r\n    return wrapped(*args, **kwargs)\r\n  File \"build/bdist.linux-x86_64/egg/googleapiclient/discovery.py\", line 193, in build\r\n    content = _retrieve_discovery_doc(requested_url, http, cache_discovery, cache)\r\n  File \"build/bdist.linux-x86_64/egg/googleapiclient/discovery.py\", line 215, in _retrieve_discovery_doc\r\n    from . import discovery_cache\r\nImportError: cannot import name discovery_cache\r\n```\r\nI've checked if `discovery_cache` module was actually part of the `egg`, and unfortunately it was not:\r\n```\r\n[root@e42fb97ce657 unit]# python\r\nPython 2.7.5 (default, Jun 24 2015, 00:41:19) \r\n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import googleapiclient.discovery_cache\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nImportError: No module named discovery_cache\r\n>>> \r\n```\r\nHere are all the files in `egg`\r\n```\r\n[root@e42fb97ce657 ~]# unzip -l /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg \r\nArchive:  /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg\r\n  Length      Date    Time    Name\r\n---------  ---------- -----   ----\r\n     1169  09-03-2015 16:09   apiclient/__init__.py\r\n     1301  09-03-2015 16:09   apiclient/__init__.pyc\r\n        1  09-03-2015 16:09   EGG-INFO/dependency_links.txt\r\n       62  09-03-2015 16:09   EGG-INFO/requires.txt\r\n       26  09-03-2015 16:09   EGG-INFO/top_level.txt\r\n      969  09-03-2015 16:09   EGG-INFO/PKG-INFO\r\n        1  09-03-2015 16:09   EGG-INFO/zip-safe\r\n      545  09-03-2015 16:09   EGG-INFO/SOURCES.txt\r\n    53575  09-03-2015 16:09   googleapiclient/http.py\r\n     9910  09-03-2015 16:09   googleapiclient/channel.py\r\n    40890  09-03-2015 16:09   googleapiclient/discovery.py\r\n     9907  09-03-2015 16:09   googleapiclient/schema.pyc\r\n      620  09-03-2015 16:09   googleapiclient/__init__.py\r\n     9317  09-03-2015 16:09   googleapiclient/schema.py\r\n    11830  09-03-2015 16:09   googleapiclient/model.py\r\n     4047  09-03-2015 16:09   googleapiclient/sample_tools.py\r\n     6552  09-03-2015 16:09   googleapiclient/mimeparse.py\r\n    53976  09-03-2015 16:09   googleapiclient/http.pyc\r\n     7043  09-03-2015 16:09   googleapiclient/mimeparse.pyc\r\n     6333  09-03-2015 16:09   googleapiclient/errors.pyc\r\n     3131  09-03-2015 16:09   googleapiclient/sample_tools.pyc\r\n     3622  09-03-2015 16:09   googleapiclient/errors.py\r\n    35534  09-03-2015 16:09   googleapiclient/discovery.pyc\r\n    14028  09-03-2015 16:09   googleapiclient/model.pyc\r\n      175  09-03-2015 16:09   googleapiclient/__init__.pyc\r\n    10690  09-03-2015 16:09   googleapiclient/channel.pyc\r\n---------                     -------\r\n   285254                     26 files\r\n[root@e42fb97ce657 ~]# \r\n```\r\n\r\nAs a workaround I had to add `googleapiclient/discovery_cache` to the `packages` in `setup.py` so it looked like that:\r\n\r\n```\r\n[root@e42fb97ce657 google-api-python-client]# more setup.py | grep packages -A 4 -m1\r\npackages = [\r\n    'apiclient',\r\n    'googleapiclient',\r\n    'googleapiclient/discovery_cache'\r\n]\r\n```\r\n\r\nThen installed and everything magically started working.\r\n\r\n```\r\n[root@e42fb97ce657 google-api-python-client]# python\r\nPython 2.7.5 (default, Jun 24 2015, 00:41:19) \r\n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import googleapiclient.discovery_cache\r\n>>> \r\n```\r\n\r\nHere is a quick sample that looks similar to my environment using `Docker`:\r\n\r\n```\r\nFROM centos:centos7\r\n\r\nRUN yum install -y git python-devel python-setuptools unzip\r\nRUN easy_install pip\r\nRUN cd /tmp ;\\\r\n    git clone https://github.com/google/google-api-python-client && \\\r\n    cd google-api-python-client && \\\r\n    python setup.py install \r\n```\r\n\r\nI've also tried to follow preferred suggestion from the `README.md` and install it from `pip` but it ended up in the same situation.\r\n\r\nPlease advice on how to proceed without making \"manual\" modifications to the official package?"},"comment":{"url":"https://api.github.com/repos/google/google-api-python-client/issues/comments/137580707","html_url":"https://github.com/google/google-api-python-client/issues/128#issuecomment-137580707","issue_url":"https://api.github.com/repos/google/google-api-python-client/issues/128","id":137580707,"user":{"login":"sergey-ob","id":4041590,"avatar_url":"https://avatars.githubusercontent.com/u/4041590?v=3","gravatar_id":"","url":"https://api.github.com/users/sergey-ob","html_url":"https://github.com/sergey-ob","followers_url":"https://api.github.com/users/sergey-ob/followers","following_url":"https://api.github.com/users/sergey-ob/following{/other_user}","gists_url":"https://api.github.com/users/sergey-ob/gists{/gist_id}","starred_url":"https://api.github.com/users/sergey-ob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergey-ob/subscriptions","organizations_url":"https://api.github.com/users/sergey-ob/orgs","repos_url":"https://api.github.com/users/sergey-ob/repos","events_url":"https://api.github.com/users/sergey-ob/events{/privacy}","received_events_url":"https://api.github.com/users/sergey-ob/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T21:34:23Z","updated_at":"2015-09-03T21:34:23Z","body":"@tmatsuo  @nathanielmanistaatgoogle Thank you guys for so quick response. Appreciate that. "}}