Running GAE GCS on PyCharm under OS X, runtime error “No module named cloudstorage”

前端 未结 4 2163
轮回少年
轮回少年 2021-02-20 13:11

I am trying to add Google Cloud Storage functionality to a Python GAE app that is already running with significant functionality. I work entirely within PyCharm on my developmen

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-20 13:59

    The accepted answer's solution

    import lib.module_name
    

    definitely can solve the problem. But I don't like add lib in front of every single module and happened to see how Google suggest import third party libs like this.

    appengine will automatically run a file called appengine_config.py. So you can create such a file and put

    from google.appengine.ext import vendor
    vendor.add('lib')
    

    inside that file. This will help you tell appengine to find dependencies in that folder, so you can simply write

    import cloudstorage as gcs
    

提交回复
热议问题