Google App Engine and Human API python lib
Asked Answered
T

0

0

I am trying to use the Human Api Python client with GAE.

I created a appengine_config.py and followed all instructions as described in Third-party Libraries in Python 2.7 documentation for GAE


My appengine_config.py looks like:

"""This file is loaded when starting a new application instance."""

from google.appengine.ext import vendor

# Add any libraries installed in the "lib" folder.
vendor.add('lib')

My requirements.txt looks like so:

HumanAPI

... and installs correctly:

Downloading/unpacking HumanAPI (from -r requirements.txt (line 1))
  Downloading humanapi-0.1.10.tar.gz
  Running setup.py (path:/private/var/folders/yq/s_1v2vtn2sxbtw_gz00q1r5w0000gp/T/pip_build_jimmykane/HumanAPI/setup.py) egg_info for package HumanAPI

Downloading/unpacking requests>=0.13.2 (from HumanAPI->-r requirements.txt (line 1))
  Downloading requests-2.6.0-py2.py3-none-any.whl (469kB): 469kB downloaded
Downloading/unpacking docopt==0.4.0 (from HumanAPI->-r requirements.txt (line 1))
  Downloading docopt-0.4.0.tar.gz
  Running setup.py (path:/private/var/folders/yq/s_1v2vtn2sxbtw_gz00q1r5w0000gp/T/pip_build_jimmykane/docopt/setup.py) egg_info for package docopt

Installing collected packages: HumanAPI, requests, docopt
  Running setup.py install for HumanAPI

  Running setup.py install for docopt

Successfully installed HumanAPI requests docopt
Cleaning up...

But when I try to import:

from humanapi import get_authorize_url, get_auth_session

I get:

ERROR    2015-03-27 13:18:05,023 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/jimmykane/projects/dimitrioskanellopoulos.com/main.py", line 2, in <module>
    from controllers import server, auth, metrics
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/controllers/auth.py", line 9, in <module>
    from humanapi import get_authorize_url, get_auth_session
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/humanapi/__init__.py", line 1, in <module>
    from .api import *
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/humanapi/api.py", line 1, in <module>
    import requests, os.path, logging, sys, time
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/compat.py", line 42, in <module>
    from .packages.urllib3.packages.ordered_dict import OrderedDict
  File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/packages/__init__.py", line 95, in load_module
    raise ImportError("No module named '%s'" % (name,))

PIP version is 6.0.8

Anyone to help me solving this dependancy thingy or guide me to what I am doing wrong?

Thanks

Teary answered 27/3, 2015 at 13:29 Comment(5)
Is your pip version 6.0.0 or later?Ferule
@RomanLevin I'll take a look at that asap and indeed I am only testing on Dev. Will reply tomorrow.Teary
@RomanLevin Upgraded pip to 6 this morning but the issue persistsTeary
You reinstalled the package?Ferule
@RomanLevin Of course. Also deployed live and still the same issueTeary

© 2022 - 2024 — McMap. All rights reserved.