Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

AttributeError: module 'asyncio' has no attribute 'async' #319

Closed
delleceste opened this issue Dec 3, 2019 · 3 comments
Closed

AttributeError: module 'asyncio' has no attribute 'async' #319

delleceste opened this issue Dec 3, 2019 · 3 comments

Comments

@delleceste
Copy link

Hello.
Cloned and built PyTango

Python version 3.7

ensure_future = getattr(asyncio, 'ensure_future', getattr(asyncio, 'async'))

I get this

giacomo@woody~ $ python
Python 3.7.5 (default, Nov 15 2019, 13:43:34)
[GCC 9.2.1 20191115 gcc-9-branch@278291] on linux
Type "help", "copyright", "credits" or "license" for more information.

import PyTango
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.7/site-packages/pytango-9.2.2.dev0-py3.7-linux-x86_64.egg/PyTango.py", line 49, in
'constants': 'constants'},
File "/usr/lib/python3.7/site-packages/pytango-9.2.2.dev0-py3.7-linux-x86_64.egg/PyTango.py", line 23, in alias_package
import(name)
File "/usr/lib/python3.7/site-packages/pytango-9.2.2.dev0-py3.7-linux-x86_64.egg/tango/asyncio_executor.py", line 40, in
ensure_future = getattr(asyncio, 'ensure_future', getattr(asyncio, 'async'))
AttributeError: module 'asyncio' has no attribute 'async'

Thanks, Giacomo.

@ajoubertza
Copy link
Member

Hi @delleceste.
Thanks for the stack trace. The paths in that trace show "pytango-9.2.2.dev0", but the latest release is 9.3.1. Did you clone the latest from the develop branch? Did you pip install the source you built?

By the way, the recommended usage is now to import tango instead of import PyTango. The old method is still available as an alias, but one day it may be removed.

@AntoineDupre
Copy link
Contributor

Hi @delleceste

As Anton mentioned it, you are not running a pytango version compatible with python3.7.

In python3.7 async and await are protected keyword, it is no longer possible to use them as user variable/method/attribute/... name. This as been fixed in PR #205

@delleceste
Copy link
Author

delleceste commented Dec 6, 2019 via email

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

No branches or pull requests

3 participants