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

前端 未结 4 2479
轮回少年
轮回少年 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:41

    I solve the missing module issue by adding the following to my main application file (main.py):

    import os
    import sys
    sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
    

    I think this is the way Guido intended. Now my code simply says import cloudstorage as gcs. None of the lib.cloudstorage or lib/__init__.py business.

    From https://stackoverflow.com/a/37645984/1740008

提交回复
热议问题