我无法在生产GAE服务器上导入ctypes,导致我们的代码中断。看起来,urllib和urllib2也依赖于这个库,但不知何故可以通过控制台在生产中导入它们(例如导航到www.myapp.com/console)。这是一个功能还是一个bug?谢谢!
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
答案 0 :(得分:0)
ctypes在Python 2.5运行时或当前的Python 2.7运行时中不可用。有关详细信息,请参阅knowledge base,此list枚举白名单模块。