Improper asyncio installation

2,152 views
Skip to first unread message

Subhendu Ghosh

unread,
Apr 6, 2014, 2:45:29 PM4/6/14
to python...@googlegroups.com
Hi all, I am trying to make a chat app using pulsar and django. asyncio is a dependency as you can see below.

[subho@localhost djangoapp]$ python manage.py pulse
Traceback (most recent call last):
  File "manage.py", line 56, in <module>
    execute_from_command_line()
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/pulsar/__init__.py", line 58, in <module>
    from .async import *
  File "/usr/lib/python2.7/site-packages/pulsar/async/__init__.py", line 2, in <module>
    from .access import *
  File "/usr/lib/python2.7/site-packages/pulsar/async/access.py", line 8, in <module>
    import asyncio
ImportError: No module named asyncio
[subho@localhost djangoapp]$ pwd
/home/subho/Downloads/flareGet/Compressed/pulsar-0.8.0/examples/djangoapp

So i tried installing asyncio

[subho@localhost djangoapp]$ sudo pip install asyncio
Downloading/unpacking asyncio
  Downloading asyncio-0.4.1.tar.gz (150kB): 150kB downloaded
  Running setup.py egg_info for package asyncio
    
Installing collected packages: asyncio
  Running setup.py install for asyncio
      File "/usr/lib/python2.7/site-packages/asyncio/base_events.py", line 116
        yield from waiter
                 ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/base_subprocess.py", line 73
        _, pipe = yield from loop.connect_write_pipe(
                           ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/events.py", line 181
        def getaddrinfo(self, host, port, *, family=0, type=0, proto=0, flags=0):
                                           ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/futures.py", line 140
        def __init__(self, *, loop=None):
                            ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/locks.py", line 96
        def __init__(self, *, loop=None):
                            ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/queues.py", line 37
        def __init__(self, maxsize=0, *, loop=None):
                                       ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/selector_events.py", line 41
        def _make_socket_transport(self, sock, protocol, waiter=None, *,
                                                                       ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/selectors.py", line 39
        "{!r}".format(fileobj)) from None
                                   ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/streams.py", line 37
        def open_connection(host=None, port=None, *,
                                                   ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/subprocess.py", line 106
        yield from waiter
                 ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/tasks.py", line 86
        res = yield from res
                       ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/test_utils.py", line 124
        def _run_test_server(*, address, use_ssl=False, server_cls, server_ssl_cls):
                              ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/unix_events.py", line 158
        yield from transp._post_init()
                 ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/windows_events.py", line 38
        def __init__(self, ov, *, loop=None):
                                ^
    SyntaxError: invalid syntax
    
      File "/usr/lib/python2.7/site-packages/asyncio/windows_utils.py", line 64
        def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
                  ^
    SyntaxError: invalid syntax
    
    
Successfully installed asyncio
Cleaning up...
[subho@localhost djangoapp]$ python manage.py pulse
Traceback (most recent call last):
  File "manage.py", line 46, in <module>
    import pulsar
  File "/usr/lib/python2.7/site-packages/pulsar/__init__.py", line 57, in <module>
    from .utils.config import *
  File "/usr/lib/python2.7/site-packages/pulsar/utils/config.py", line 30, in <module>
    from .internet import parse_address
  File "/usr/lib/python2.7/site-packages/pulsar/utils/internet.py", line 29, in <module>
    from .httpurl import urlsplit, parse_qsl, urlencode
  File "/usr/lib/python2.7/site-packages/pulsar/utils/httpurl.py", line 56, in <module>
    from .structures import mapping_iterator, OrderedDict
  File "/usr/lib/python2.7/site-packages/pulsar/utils/structures/__init__.py", line 52, in <module>
    from .zset import Zset
  File "/usr/lib/python2.7/site-packages/pulsar/utils/structures/zset.py", line 2, in <module>
    from ..pep import iteritems, zip
  File "/usr/lib/python2.7/site-packages/pulsar/utils/pep.py", line 8, in <module>
    from asyncio.py33_exceptions import reraise
  File "/usr/lib/python2.7/site-packages/asyncio/__init__.py", line 9, in <module>
    from . import selectors
  File "/usr/lib/python2.7/site-packages/asyncio/selectors.py", line 39
    "{!r}".format(fileobj)) from None
                               ^
SyntaxError: invalid syntax

how to install asyncio correctly? any help welcome. Thank you.

Aymeric Augustin

unread,
Apr 6, 2014, 3:21:52 PM4/6/14
to Subhendu Ghosh, python...@googlegroups.com
On 6 avr. 2014, at 20:45, Subhendu Ghosh <subh...@gmail.com> wrote:

> how to install asyncio correctly? any help welcome. Thank you.

You’re using Python 2.7, asyncio requires Python 3.3.

--
Aymeric.




Subhendu Ghosh

unread,
Apr 6, 2014, 4:39:09 PM4/6/14
to python...@googlegroups.com, Subhendu Ghosh
Thanks! m bad should have read the pypi page carefully. :)

Victor Stinner

unread,
Apr 6, 2014, 4:51:37 PM4/6/14
to Subhendu Ghosh, python...@googlegroups.com
You should install Trollius, not asyncio.

Victor
Reply all
Reply to author
Forward
0 new messages