Receiving .async error when trying to import the firebase package

大憨熊 提交于 2020-04-12 18:01:50

问题



I'm trying to write a python script that requires a connection to firebase. I've installed the python-firebase package, but when I import it into my program using 'import firebase', I get the following error:

Traceback (most recent call last):
  File "C:\Users\hajel\AppData\Local\Programs\Python\Python37-32\Scripts\RFIDHandler.py", line 1, in <module>
    import firebase
  File "C:\Users\hajel\AppData\Local\Programs\Python\Python37-32\lib\site-packages\firebase\__init__.py", line 3
    from .async import process_pool
              ^
SyntaxError: invalid syntax

回答1:


The problem is that async is a keyword in python 3.7 the solution is quite simple.

Just rename the file async.py to something other like asyncn.py and replace every from .async import process_pool in the files firebase.py , decorators.py and others , to from .asyncn import process_pool




回答2:


I commented "#from .async import process_pool" in firebase.py and started working, it was incompatible with python 3.7




回答3:


ya because your action is wrong its a system-generated file don't comment it just follows steps

1)rename .async into .async_

2)open__init__ file and change .async into .async_

3)open firebase.py and change .async into .async_

because of .async is the keyword now is current version in python

Done>>>>>>>>>>



来源:https://stackoverflow.com/questions/52133031/receiving-async-error-when-trying-to-import-the-firebase-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!