【发布时间】:2016-06-29 12:08:31
【问题描述】:
我正在尝试在谷歌应用引擎上部署一个 python2.7 应用程序。它使用了几个模块,如 numpy、flask、pandas 和 scikit-learn。虽然我能够安装和使用其他模块。在项目的 lib 文件夹中安装 scikit-learn 会出现以下错误:-
Traceback(最近一次调用最后一次):文件“/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py”,第 240 行,在句柄处理程序中= _config_handle.add_wsgi_middleware(self._LoadHandler()) 文件“/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py”,第 299 行,在 _LoadHandler 处理程序中,路径,错误 = LoadObject(self._handler) 文件“/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py”,第 85 行,在 LoadObject obj = __import__(path[0 ]) 文件“/base/data/home/apps/s~category-prediction-1247/v1.391344087004233892/deploynew.py”,第 6 行,导入 sklearn 文件“/base/data/home/apps/s~category -prediction-1247/v1.391344087004233892/lib/sklearn/__init__.py”,第 56 行,来自 .导入 __check_build 文件“/base/data/home/apps/s~category-prediction-1247/v1.391344087004233892/lib/sklearn/__check_build/__init__.py”,第 46 行,在 raise_build_error(e) 文件“/base/data /home/apps/s~category-prediction-1247/v1.391344087004233892/lib/sklearn/__check_build/__init__.py",第 41 行,在 raise_build_error %s""" % (e, local_dir, ''.join(dir_content ).strip(), msg)) ImportError: dynamic module does not defined init function (init_check_build) ___________________________________________________________________________ /base/data/home/apps/s~category-prediction-1247/v1.391344087004233892/lib/sklearn/__check_build的内容: setup.pyc __init__.py _check_build.so setup.py __init__.pyc ___________________________________________________________________________ scikit-learn 好像没有正确构建,如果你已经从源码安装了 scikit-learn,请不要忘记在使用前构建包:在源目录中运行python setup.py install 或make。如果你已使用安装程序,请检查它是否适合您的 Python 版本、操作系统和平台。
他们有在谷歌应用引擎上使用 scikit-learn 的任何方式吗?
【问题讨论】:
-
App 引擎出现此错误。我能够在我正在部署的存储库的 lib 文件夹中使用 pip install -t lib scikit-learn 成功安装 Scikit-learn
标签: python python-2.7 google-app-engine scikit-learn