简体   繁体   中英

Can't import the ctypes python library in Google App Engine

I can't import ctypes on the production GAE server, which is causing our code to break. Seemingly, urllib and urllib2 also rely on this library, but somehow it's possible to import them on production through the console (eg navigate to www.myapp.com/console). Is this a feature or a bug? Thanks!

Python 2.5.2 (r252:60911, Mar 17 2011, 15:16:30) 
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(Google App Engine/1.5.1)
>>> from lib import cloud
 Traceback (most recent call last):
  File "/base/data/home/apps/s~getprofound1/1-01.351465921648985319/console/app/models/console.py", line 170, in processSource
    exec bytecode in statement_module.__dict__
  File "<string>", line 1, in <module>
  File "/base/data/home/apps/s~getprofound1/1-01.351465921648985319/lib/cloud/__init__.py", line 102, in <module>
    from . import cloudconfig as cc
  File "/base/data/home/apps/s~getprofound1/1-01.351465921648985319/lib/cloud/cloudconfig.py", line 50, in <module>
    from .util import configmanager
  File "/base/data/home/apps/s~getprofound1/1-01.351465921648985319/lib/cloud/util/__init__.py", line 25, in <module>
    import ctypes
  File "/base/python_runtime/python_dist/lib/python2.5/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes

ctypes is not available in the Python 2.5 runtime or in the current Python 2.7 runtime. See the knowledge base for more details and this list enumerating white-listed module.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM