Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'coroutine' #10

Closed
VAdamec opened this issue Oct 22, 2014 · 4 comments
Closed

AttributeError: 'NoneType' object has no attribute 'coroutine' #10

VAdamec opened this issue Oct 22, 2014 · 4 comments

Comments

@VAdamec
Copy link

VAdamec commented Oct 22, 2014

CentOS 65 with Python 3.3.5 (sandbox) or 2.7.6 (virtualenv)

(consulate) [root@cns-ui-prg001 consul-api]# python --version
Python 3.3.5
(consulate) [root@cns-ui-prg001 consul-api]# pip install consulate
Downloading/unpacking consulate
Downloading consulate-0.2.0.tar.gz
Running setup.py (path:/tmp/pip_build_root/consulate/setup.py) egg_info for package consulate

Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python3.3/site-packages (from consulate)
Installing collected packages: consulate
Running setup.py install for consulate

Installing consulate script to /usr/local/bin

Successfully installed consulate
Cleaning up...
(consulate) [root@cns-ui-prg001 consul-api]# consulate -v

Traceback (most recent call last):
File "/usr/local/bin/consulate", line 9, in
load_entry_point('consulate==0.2.0', 'console_scripts', 'consulate')()
File "/usr/local/lib/python3.3/site-packages/setuptools-7.0-py3.3.egg/pkg_resources.py", line 339, in load_entry_point
File "/usr/local/lib/python3.3/site-packages/setuptools-7.0-py3.3.egg/pkg_resources.py", line 2470, in load_entry_point
File "/usr/local/lib/python3.3/site-packages/setuptools-7.0-py3.3.egg/pkg_resources.py", line 2184, in load
File "/usr/local/lib/python3.3/site-packages/consulate/init.py", line 7, in
from consulate.api import Consulate
File "/usr/local/lib/python3.3/site-packages/consulate/api.py", line 10, in
from consulate import adapters
File "/usr/local/lib/python3.3/site-packages/consulate/adapters.py", line 59, in
class TornadoRequest(Request):
File "/usr/local/lib/python3.3/site-packages/consulate/adapters.py", line 66, in TornadoRequest
@gen.coroutine
AttributeError: 'NoneType' object has no attribute 'coroutine'

@VAdamec
Copy link
Author

VAdamec commented Oct 22, 2014

One step further:

[root@cns-ui-prg001 consul-api]# /usr/local/bin/consulate kv get test
b'[{"CreateIndex":58195,"ModifyIndex":58195,"LockIndex":0,"Key":"test","Flags":0,"Value":"VEVTVA=="}]'

but backup:

[root@server consul-api]# /usr/local/bin/consulate kv backup /opt/backup.dump
Traceback (most recent call last):
File "/usr/local/bin/consulate", line 9, in
load_entry_point('consulate==0.2.0', 'console_scripts', 'consulate')()
File "/usr/local/lib/python3.3/site-packages/consulate/cli.py", line 90, in main
handle.write(json.dumps(session.kv.records(),
File "/usr/local/lib/python3.3/site-packages/consulate/api.py", line 267, in records
response = self._get_list([''], {'recurse': None})
File "/usr/local/lib/python3.3/site-packages/consulate/api.py", line 83, in _get_list
result = self._get(params, query_params)
File "/usr/local/lib/python3.3/site-packages/consulate/api.py", line 77, in _get
response = self._adapter.get(self._build_uri(params, query_params))
File "/usr/local/lib/python3.3/site-packages/consulate/api.py", line 73, in _build_uri
urllib.urlencode(query_params))
AttributeError: 'module' object has no attribute 'urlencode'

@srri-zz
Copy link

srri-zz commented Nov 15, 2014

you need to have Tornado:
sudo pip install tornado

@awheeler
Copy link

The requirements.txt file in master doesn't list tornado, but the .20 version I installed on my Ubuntu 14.04 box with python 2.7 contains:

requests

[tornado]
tornado

Which produces the following when I run pip install -r against it:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 262, in run
    for req in parse_requirements(filename, finder=finder, options=options, session=session):
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1631, in parse_requirements
    req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 172, in from_line
    return cls(req, comes_from, url=url, prereleases=prereleases)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 70, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2786, in parse
    reqs = list(parse_requirements(s))
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2701, in parse_requirements
    raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '[tornado]')

Whereas if I make the file simply:

requests
tornado

it works fine.

@gmr
Copy link
Owner

gmr commented Dec 19, 2014

This was a problem with the distribution of 0.2.0. 0.3.0 will be out today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants