Skip to content

Stuck at last step: No module named apiclient #17

@lguillaumont

Description

@lguillaumont

I am stuck at step B.8. (last step)

XXX-MacBook-Air:Downloads XXX$ ./import-mailbox-to-gmail.py --json Credentials.json --dir ~/Downloads/mbox/
Traceback (most recent call last):
File "./import-mailbox-to-gmail.py", line 31, in
from apiclient import discovery
ImportError: No module named apiclient

I followed the fix proposed by http://stackoverflow.com/questions/18267749/importerror-no-module-named-apiclient-discovery:
sudo pip install --upgrade google-api-python-client

XXX-MacBook-Air:Downloads XXX$ sudo pip install --upgrade google-api-python-client
Password:
The directory '/Users/lguillaumont/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/lguillaumont/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: google-api-python-client in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already up-to-date: oauth2client<4.0.0,>=1.5.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from google-api-python-client)
Requirement already up-to-date: six<2,>=1.6.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from google-api-python-client)
Requirement already up-to-date: httplib2<1,>=0.8 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from google-api-python-client)
Requirement already up-to-date: uritemplate<1,>=0.6 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from google-api-python-client)
Requirement already up-to-date: pyasn1>=0.1.7 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from oauth2client<4.0.0,>=1.5.0->google-api-python-client)
Requirement already up-to-date: pyasn1-modules>=0.0.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from oauth2client<4.0.0,>=1.5.0->google-api-python-client)
Requirement already up-to-date: rsa>=3.1.4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from oauth2client<4.0.0,>=1.5.0->google-api-python-client)
Requirement already up-to-date: simplejson>=2.5.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from uritemplate<1,>=0.6->google-api-python-client)

However, I believe the code should be upgraded (see second answer):

bad

from apiclient.discovery import build

good

from googleapiclient.discovery import build

Could you help fixing that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions