Search code examples
pythongoogle-app-enginebing-api

GAE Python bingapi wrapper ImportError


So here is my problem: I am trying to use the bing api wrapper available here

I basically downloaded the egg file and installed it according to the guidelines. When I run the sample code from command line it works fine. However, I am trying to integrate this wrapper into the Python Google App Engine application that I have. When I try to import the bingapi and run the GAE. I get the following error in the browser: Any suggestions will be appreciated. I have been searching for this across all the web but no success

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' 

Solution

  • dev_appserver.py mimics the production environment, so it blocks access to any libraries that won't be available in production, including anything installed on your system outside of your application directory. To use third-party libraries with App Engine, they must be installed in your application directory, where they'll get uploaded to the production servers.