How to upload a file to Google Cloud Storage on Python 3?

前端 未结 4 1082
刺人心
刺人心 2020-12-02 14:41

How can I upload a file to Google Cloud Storage from Python 3? Eventually Python 2, if it\'s infeasible from Python 3.

I\'ve looked and looked, but haven\'t found a

4条回答
  •  感动是毒
    2020-12-02 15:07

    When installing Google Cloud Storage API:

    pip install google-cloud

    will throw a ModuleNotFoundError:

        from google.cloud import storage
    ModuleNotFoundError: No module named 'google'
    
    

    Make sure you install as in Cloud Storage Client Libraries Docs:

    pip install --upgrade google-cloud-storage

提交回复
热议问题