ImportError: cannot import name certs

1,711 views
Skip to first unread message

Greg

unread,
Jan 6, 2015, 5:49:54 PM1/6/15
to pythonfo...@googlegroups.com
I'm trying to run the app engine example locally on my mac os 10.10.1, downloaded requests and moved it to the appengine folder. Any ideeas?

ERROR    2015-01-06 22:43:50,288 wsgi.py:263] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "/Users/mrnobody/Downloads/facebook-sdk-master/examples/appengine/example.py", line 33, in <module>
    import facebook
  File "/Users/mrnobody/Downloads/facebook-sdk-master/examples/appengine/facebook/__init__.py", line 40, in <module>
    import requests
  File "/Users/mrnobody/Downloads/facebook-sdk-master/examples/appengine/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/Users/mrnobody/Downloads/facebook-sdk-master/examples/appengine/requests/utils.py", line 25, in <module>
    from . import certs
ImportError: cannot import name certs

Martey Dodoo

unread,
Jan 6, 2015, 8:39:04 PM1/6/15
to pythonfo...@googlegroups.com
As you can see from the traceback, this is an issue with requests, not the SDK.

You could try upgrading your version of requests, as suggested in
https://github.com/kennethreitz/requests/issues/2028.
Message has been deleted

Russell Bega

unread,
Jan 22, 2015, 3:45:48 PM1/22/15
to pythonfo...@googlegroups.com
Tried for like 2 hours how to fix this problem and its impossible.

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 298, in _LoadHandler

    handler, path, err = LoadObject(self._handler)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 84, in LoadObject

    obj = __import__(path[0])
  File "C:\Users\Russ\Desktop\facebook-sdk-master\examples\appengine\example.py", line 33, in <module>
    import facebook
  File "C:\Python27\lib\facebook\__init__.py", line 39, in <module>
    import requests
  File "C:\Python27\lib\requests\__init__.py", line 58, in <module>
    from . import utils
  File "C:\Python27\lib\requests\utils.py", line 25, in <module>

    from . import certs
ImportError: cannot import name certs
INFO     2015-01-21 23:12:07,365 module.py:659] default: "GET /favicon.ico HTTP/1.1" 500 -

And i have the certs.py and certs.pyc that come with requests in the same folder.. i cant find the solution!

Justin Grayston

unread,
Jan 22, 2015, 5:14:16 PM1/22/15
to pythonfo...@googlegroups.com
I just had the same error, that showed itself as soon as GAE SDK handled a request. When running unit tests it was fine.

What solved it was simple. I hadn't added ssl in the app.yaml under libraries

libraries:
- name: jinja2
  version: latest
- name: webapp2
  version: latest
- name: markupsafe
  version: latest
- name: ssl
  version: latest

Then request that the SDK routed worked. I think either in the last version or one before that of the SDK the sandboxing got more strict and it unloads modules you won't have by default at runtime from sys.modules.

I hope this helps someone.

Matt S

unread,
Feb 26, 2015, 10:00:17 PM2/26/15
to pythonfo...@googlegroups.com
I owe you a beer Justin!

Vedant Swain

unread,
Apr 3, 2015, 5:41:28 AM4/3/15
to pythonfo...@googlegroups.com
Thank you so much man. This cleared that error.
Reply all
Reply to author
Forward
0 new messages