0

所以这是我的问题:我正在尝试使用此处提供的 bing api 包装器

我基本上下载了egg文件并按照指南安装了它。当我从命令行运行示例代码时,它工作正常。但是,我正在尝试将此包装器集成到我拥有的 Python Google App Engine 应用程序中。当我尝试导入 bingapi 并运行 GAE 时。我在浏览器中收到以下错误:任何建议将不胜感激。我一直在整个网络上搜索这个但没有成功

zef_file undefined, builtin open = <built-in function open>, self = <zipfile.ZipFile instance at 0x104130200>, self.filename = '/Library/Python/2.6/site-packages/bingapi-0.02.egg'
 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py in __init__(self=<closed file '<uninitialized file>', mode '<uninitialized file>' at 0x1041c6e10>, filename='/Library/Python/2.6/site-packages/bingapi-0.02.egg', mode='rb', bufsize=-1, **kwargs={})
  557 
  558     if not FakeFile.IsFileAccessible(filename):
  559       raise IOError(errno.EACCES, 'file not accessible', filename)
  560 
  561     super(FakeFile, self).__init__(filename, mode, bufsize, **kwargs)
builtin IOError = <type 'exceptions.IOError'>, global errno = <module 'errno' (built-in)>, errno.EACCES = 13, filename = '/Library/Python/2.6/site-packages/bingapi-0.02.egg'

<type 'exceptions.IOError'>: [Errno 13] file not accessible: '/Library/Python/2.6/site-packages/bingapi-0.02.egg'
      args = (13, 'file not accessible')
      errno = 13
      filename = '/Library/Python/2.6/site-packages/bingapi-0.02.egg'
      message = ''
      strerror = 'file not accessible' 
4

1 回答 1

2

dev_appserver.py 模仿生产环境,因此它会阻止对生产中不可用的任何库的访问,包括安装在系统上的应用程序目录之外的任何内容。要在 App Engine 中使用第三方库,它们必须安装在您的应用程序目录中,然后它们将被上传到生产服务器。

于 2011-11-18T12:33:08.127 回答