我试图在谷歌应用程序引擎上部署python2.7应用程序.它使用了几个模块,如numpy,flask,pandas和scikit-learn.虽然我能够安装和使用其他模块.在项目的lib文件夹中安装scikit-learn会出现以下错误: -
回溯(最近一次调用最后一次):文件"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py",第240行,在Handle handler = _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行,来自.import __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:动态模块没有定义init函数(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 from source,请不要忘记在使用之前构建软件包:运行python setup.py install或make在源目录中.如果您使用过安装程序,请检查它是否适合您的Python版本,操作系统和平台.
他们在谷歌应用引擎上使用scikit-learn的任何方式?
我有一个 base64 编码的图像数据。我正在粘贴前几个字符
string='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD /2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopG R8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgo......'
Run Code Online (Sandbox Code Playgroud)
我正在用 ruby 跟踪它
decoded_string=Base64.decode64 string
output_file = Tempfile.new(['image','.jpeg'])
output_file.binmode
output_file.write image
Run Code Online (Sandbox Code Playgroud)
在此之后,当我打开“image.jpeg”时,出现错误
Error interpreting JPEG image file (Not a JPEG file: starts with 0x75 0xab)
Run Code Online (Sandbox Code Playgroud)
我也试过
File.open('a.jpeg', 'wb') do|f|
f.write decoded_string
end
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我也遇到了同样的错误。
我究竟做错了什么?