Skip to content

ImportError: No module named http_client #2014

Closed

Description

@liumingming

When I type from gcloud import datastore

them

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "gcloud/datastore/__init__.py", line 53, in <module>
    from gcloud.datastore.batch import Batch
  File "gcloud/datastore/batch.py", line 24, in <module>
    from gcloud.datastore import helpers
  File "gcloud/datastore/helpers.py", line 27, in <module>
    from gcloud._helpers import _datetime_to_pb_timestamp
  File "gcloud/_helpers.py", line 34, in <module>
    from six.moves.http_client import HTTPConnection
ImportError: No module named http_client

Activity

  1. daspecster commented on Jul 22, 2016

    @daspecster
    Contributor

    How did you install gcloud-python?

    You could try pip install --upgrade six since it looks like you may be using an older version of `six.

    Let me know if that changes anything!

  2. dhermes commented on Jul 22, 2016

    @dhermes
    Contributor

    If you are on Mac OS X you may not be able to upgrade six

  3. liumingming commented on Jul 27, 2016

    @liumingming
    Author

    Yes, i am on Mac os X,but i have already upgrade six package,it still not working,it is great on linux

  4. dhermes commented on Jul 27, 2016

    @dhermes
    Contributor

    Apple both locks down the system installed six package and puts that same package on your import path in front of where you've installed it. Run

    $ python -c 'import six; print(six.__file__)'
    

    to see where it is actually getting imported from and you'll see the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions