GAE Python PyML ImportError: No module named _ckernel
GAE Python PyML ImportError: No module named _ckernel
我正在尝试在 Google App Engine 上导入 PyML 作为另一个库的要求,但是我收到以下导入错误:
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/__init__.py", line 4, in <module>
from PyML.containers import *
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/__init__.py", line 3, in <module>
VectorDataSet = __import__('PyML.containers.vectorDatasets', fromlist=['']).VectorDataSet
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/vectorDatasets.py", line 5, in <module>
from PyML.containers.baseDatasets import WrapperDataSet, BaseVectorDataSet
File "/base/data/home/apps/s~replimeapp/uno.385079313378714244/PyML/containers/baseDatasets.py", line 4, in <module>
from PyML.containers import ker
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ker.py", line 6, in <module>
from ext import ckernel
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ext/ckernel.py", line 25, in <module>
_ckernel = swig_import_helper()
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ext/ckernel.py", line 17, in swig_import_helper
import _ckernel
ImportError: No module named _ckernel
我在网上搜索过这个错误,也可以找到其他人遇到过这个问题,但是没有给出答案。
更新
导致错误的代码:
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_ckernel', [dirname(__file__)])
except ImportError:
import _ckernel
return _ckernel
if fp is not None:
try:
_mod = imp.load_module('_ckernel', fp, pathname, description)
finally:
fp.close()
return _mod
_ckernel = swig_import_helper()
del swig_import_helper
else:
import _ckernel
del version_info
该代码似乎使用了 swig。 Appengine 运行time 沙箱将基于 'c' 的二进制库限制为受支持的集合。 Swig 通常意味着编译的 C/C++ 包裹在 Python 中。所以看起来这不能在 appengine 上 运行,除非他们有一个纯粹的 python 选项。
您可以 运行 它在托管 VM 下。
您可能应该回去阅读 Appengine Python 沙盒及其限制以及直接支持的第 3 方库可用的内容。
我正在尝试在 Google App Engine 上导入 PyML 作为另一个库的要求,但是我收到以下导入错误:
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/__init__.py", line 4, in <module>
from PyML.containers import *
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/__init__.py", line 3, in <module>
VectorDataSet = __import__('PyML.containers.vectorDatasets', fromlist=['']).VectorDataSet
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/vectorDatasets.py", line 5, in <module>
from PyML.containers.baseDatasets import WrapperDataSet, BaseVectorDataSet
File "/base/data/home/apps/s~replimeapp/uno.385079313378714244/PyML/containers/baseDatasets.py", line 4, in <module>
from PyML.containers import ker
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ker.py", line 6, in <module>
from ext import ckernel
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ext/ckernel.py", line 25, in <module>
_ckernel = swig_import_helper()
File "/base/data/home/apps/s~myapp/uno.385079313378714244/PyML/containers/ext/ckernel.py", line 17, in swig_import_helper
import _ckernel
ImportError: No module named _ckernel
我在网上搜索过这个错误,也可以找到其他人遇到过这个问题,但是没有给出答案。
更新 导致错误的代码:
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_ckernel', [dirname(__file__)])
except ImportError:
import _ckernel
return _ckernel
if fp is not None:
try:
_mod = imp.load_module('_ckernel', fp, pathname, description)
finally:
fp.close()
return _mod
_ckernel = swig_import_helper()
del swig_import_helper
else:
import _ckernel
del version_info
该代码似乎使用了 swig。 Appengine 运行time 沙箱将基于 'c' 的二进制库限制为受支持的集合。 Swig 通常意味着编译的 C/C++ 包裹在 Python 中。所以看起来这不能在 appengine 上 运行,除非他们有一个纯粹的 python 选项。
您可以 运行 它在托管 VM 下。
您可能应该回去阅读 Appengine Python 沙盒及其限制以及直接支持的第 3 方库可用的内容。