简体   繁体   English

ImportError:没有名为内置模块的模块-Google App Engine标准-Django-Python 2.7

[英]ImportError: No module named builtins - Google App Engine Standard - Django - Python 2.7

I'm trying to deploy an application and this error keeps coming up. 我正在尝试部署应用程序,并且此错误不断出现。 I am using the commands below in my views/models/form/settings.py, in order to use the same code I did for Python 3. 我在views / models / form / settings.py中使用以下命令,以使用与Python 3相同的代码。

from __future__ import absolute_import, division, print_function
from builtins import (bytes, str, open, super, range,
                  zip, round, input, int, pow, object)

I've already installed the library:future==0.16.0 on my requirements-vendor.txt 我已经在我的requirements-vendor.txt上安装了library:future == 0.16.0

On localhost I can run it, using a Conda Env (python 2.7) but the deployment on GAE(standard) I got the 500 Server Error. 在本地主机上,我可以使用Conda Env(python 2.7)运行它,但是在GAE(标准)上进行部署时,出现了500服务器错误。

App Engine Standard does not actually depends on a requirements.txt file for using third-party libraries, that's the case for App Engine Flexbile App Engine Standard实际上并不依赖于使用第三方库的requirements.txt文件, App Engine Flexbile就是这种情况

If you want to use a third-party library which is not in the list of already built-in libraries ( this list ) ,as in this case is future , you need to follow the Using third-party libraries for App Engine Standard docs , which was mentioned by @snakecharmerb. 如果您要使用不在内置库列表此列表 )中的第三方库(在这种情况下是将来的情况),则需要遵循“ 将第三方库用于App Engine标准”文档 , @snakecharmerb提到过。 Do the following n the same folder where you have your app.yaml file: 对您拥有app.yaml文件的同一文件夹执行以下操作:

  1. Create a directory where your third-party-libraries will be stored: 创建一个目录,该目录将存储您的第三方库:

    mkdir lib

  2. Install library on the created folder: 在创建的文件夹上安装库:

    pip install -t lib future==0.16.0

  3. Create file named appengine_config.py and add the following two lines to the file: 创建名为appengine_config.py文件,并将以下两行添加到文件中:

    from google.appengine.ext import vendor

    vendor.add('lib')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImportError:没有使用Python 2.7用PyHive命名为内置模块的模块 - ImportError: No module named builtins with PyHive using Python 2.7 Google App Engine(Python 2.7)Win 10 ImportError:没有名为appengine.api的模块 - Google App Engine (Python 2.7) Win 10 ImportError: No module named appengine.api Google App Engine启动器(Python)-ImportError:没有名为webapp2的模块 - Google App Engine Launcher (Python) - ImportError: No module named webapp2 Python ImportError:Google app引擎项目中没有名为main的模块 - Python ImportError: No module named main in Google app engine project ImportError:谷歌应用引擎中没有名为****的模块错误 - ImportError: No module named **** Error in google app engine ImportError:在Google App Engine上没有名为flask的模块 - ImportError: No module named flask on google app engine Google App Engine ImportError:未命名模块 - Google App Engine ImportError: No module named Google App Engine-ImportError:没有名为edf的模块 - Google App Engine - ImportError: No module named edf 谷歌应用引擎中的“导入错误:没有名为装饰器的模块” - 'ImportError: No module named decorator' in google app engine Google App Engine(Python)ImportError:Google App Engine中没有名为oauth2的模块 - Google app engine(python) ImportError: No module named oauth2 in google app engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM