No module named warnings when starting GAE inside virtualenv locally

前端 未结 3 1989
忘了有多久
忘了有多久 2021-01-02 15:27

I am trying to run my GAE app locally inside a virtual environment.

I\'ve followed these two articles [1], [2] as reference to setup, but when I source evn/bi

相关标签:
3条回答
  • 2021-01-02 15:47

    I had this problem when running two AppEngine projects in separate directories at once using dev_appserver.py in a virtualenv.

    I found it works correctly if I use absolute paths instead.

    0 讨论(0)
  • 2021-01-02 15:51

    All dependencies for standard environment GAE apps (which aren't provided by GAE) must be installed in the app itself, not on your local system. See Using third-party libraries.

    Since GAE doesn't care about your local system libraries (besides the basic python 2.7 installation needed to run the development server), using a virtualenv for developing standard env GAE apps doesn't make a lot of sense.

    The use of the virtualenv as suggested by the articles you mentioned can actually cause trouble:

    • local python libraries can interfere with the GAE runtime-provided equivalent libraries (from the SDK) when running locally (I suspect this is somehow what you're experiencing)
    • at deployment time the content of the lib directory (which includes all the site packages for your python installation) will be uploaded to GAE, potentially causing clashes with the GAE runtime-provided libraries or exceeding the app file quota.

    So my suggestion is to drop virtualenv (which, in a way, you did when you skipped the virtualenv activation) and follow the official documentation instead.

    0 讨论(0)
  • 2021-01-02 16:02

    I've solved it by removing from the skip_files of my .yaml a - venv line. venv is my virtualenv folder, and I still have a - ^venv$ line. In case that helps someone ;-)

    0 讨论(0)
提交回复
热议问题