Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t在Google App Engine中导入ctypes python库_Python_Google App Engine_Ctypes - Fatal编程技术网

Can';t在Google App Engine中导入ctypes python库

Can';t在Google App Engine中导入ctypes python库,python,google-app-engine,ctypes,Python,Google App Engine,Ctypes,我无法在生产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

我无法在生产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
Python 2.5.2(r252:60911,2011年3月17日,15:16:30)
[GCC 4.3.1]关于linux2
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
(谷歌应用程序引擎/1.5.1)
>>>从lib导入云
回溯(最近一次呼叫最后一次):
processSource中的文件“/base/data/home/apps/s~getdefound1/1-01.3514659121648985319/console/app/models/console.py”,第170行
语句模块中的exec字节码__
文件“”,第1行,在
文件“/base/data/home/apps/s~getdefound1/1-01.351465921648985319/lib/cloud/_init__.py”,第102行,在
从…起将cloudconfig作为cc导入
文件“/base/data/home/apps/s~getdefound1/1-01.3514659121648985319/lib/cloud/cloudconfig.py”,第50行,在
从.util导入configmanager
文件“/base/data/home/apps/s~getdefound1/1-01.351465921648985319/lib/cloud/util/__init__u;.py”,第25行,在
导入ctypes
文件“/base/python\u runtime/python\u dist/lib/python2.5/ctypes/\uuuuuu init\uuuuuu.py”,第10行,在
从类型导入联合、结构、数组
ImportError:没有名为_ctypes的模块

ctypes在Python 2.5运行时或当前的Python 2.7运行时中不可用。有关更多详细信息和此列举的白名单模块,请参阅。

在GAE中导入
ctypes
的任何功能都肯定是一个bug。
urllib
和App Engine上的
urllib2
是围绕
google.appengine.api.urlfetch
提供的包装,用于与第三方模块兼容。他们不使用
ctypes
。ctypes似乎已经添加到Python2.7中,GAE端点库依赖于它。但这肯定会让我心痛!!