Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved reference async/await in PyCharm

Sometimes in PyCharm 2017.1.4 with python3.6 async/await statements show as unresolved, although there aren't any errors and in next tab async/await not underlined as an error.

Restarting fix this issue. How to fix that?

image

like image 627
comalex3 Avatar asked Jun 19 '17 20:06

comalex3


2 Answers

I encountered the same issue since I erroneously used the 'await' outside of an async method (Interpreter set to Python 3.6). 'await' is only valid in an 'async' method using Python 3.6. Pycharm correctly produces the error, but the message 'await unresolved' is not specific.

like image 179
giwyni Avatar answered Dec 04 '22 20:12

giwyni


I just hit the same problem. It was because the project interpreter was set to python2.7, the await/async keys are new as of python3, and not backward compatible.

preferences>project>project-interpreter is where I could select the correction version.

like image 25
Luke Exton Avatar answered Dec 04 '22 22:12

Luke Exton