0

I'm trying to import PyML on Google App Engine as a requirement for another library, however I am getting the following import error:

  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

I've searched for this error online and can find other people that had the issue, however no answers are given.

UPDATE Code which causes the error:

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
Vincent
  • 1,137
  • 18
  • 40

1 Answers1

1

That code appears to be using swig. Appengine runtime sandbox limits 'c' based binary libs to a supported set. Swig typically implies compiled C/C++ wrapped in Python. So it would appear this can not run on appengine, unless they have a pure python option.

You could run it under a managed VM.

You should probably go back and have a read up on the appengine Python sandbox and it's limitations and what directly supported 3rd party libraries are available.

Tim Hoffman
  • 12,976
  • 1
  • 17
  • 29
  • Hmm that's disappointing. What do you mean by a managed VM? Any resource you could refer me to? Else would running an app on Heroku as "API" be a solution? – Vincent Jun 17 '15 at 11:02
  • 1
    https://cloud.google.com/appengine/docs/managed-vms/ but just searching for appengine managed vm would have found the same link for you. – Tim Hoffman Jun 18 '15 at 09:13