简体   繁体   中英

Downloading and importing Google Cloud Python

I'm on their github page: https://github.com/GoogleCloudPlatform/google-cloud-python

Their first command is pip install --upgrade google-cloud

this gives me:

Collecting google-cloud
  Could not find a version that satisfies the requirement google-cloud (from versions: )
No matching distribution found for google-cloud

I downloaded their SDK and which installed their google cloud SDK and I did gcloud init, but I can't seem to have their python library imported into mine. Starting python and typing:

from google.cloud import datastore

gives me an error that it doesn't exist as a module... This is all from their github so I'm not sure what I'm doing wrong

The issue is that the team is trying to transition from gcloud to google-cloud which is still somewhere incomplete.

All you need to do is install gcloud using pip and you should be fine.

Pro Tip: python -m pip install --upgrade gcloud using this command will install it for your python version.

First, make sure you have installed gcloud on your system then run the commands like this:

First: gcloud components update in your terminal.

then: pip install google-cloud

And for the import error:

I had a similar problem. Adding "--ignore-installed" to my pip command made it work for me.

This might be a bug in pip - see this page for more details: https://github.com/pypa/pip/issues/2751

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM