Gae Python's Importmodules{no module named%s} workaround

Source: Internet
Author: User

I want to see the tornado on GitHub to write the demo---blog, so on GitHub paste copy, paste copy,

When you open it with Gae, you find that you can't get up and look at log.

File "E:\Python27\lib\ctypes\__init__.py", line ten, in <module>

From _ctypes import Union, Structure, Array

File "E:\GAE\google\appengine\tools\devappserver2\python\sandbox.py", line-in-load_module

Raise Importerror (' No module named%s '% fullname)

So search Google to find Baidu, finally found a solution: http://stackoverflow.com/questions/6431495/ How-do-i-know-if-my-code-is-running-deployed-on-gae-or-running-local

In fact, because Gae does not support certain modules of PYTHON2.7, it fully supports the 2.5

We went into just that sandbox.py, looking for Importerror (' No module named%s '% fullname) to find this sentence:

  defFind_module (self, fullname, path=None):if(FullNameinch_white_list_c_modulesorAny (Regex.match (fullname) forRegexinchself._enabled_regexes)):returnNoneifSelf._module_type (fullname, Path)inch[Imp. C_extension, Imp. C_builtin]:return SelfreturnNonedefLoad_module (Self, fullname):RaiseImporterror ('No module named%s'% fullname)
_white_list_c_modules is the white list, add the wrong module name, finished~,run~~,successful~~~~~hoho~~~

Gae python importmodules{no module named%s} workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.