尝试导入Firebase程序包时收到.async错误 [英] Receiving .async error when trying to import the firebase package
问题描述
我正在尝试编写一个需要连接到Firebase的python脚本.我已经安装了python-firebase软件包,但是当我使用"import firebase"将其导入到程序中时,出现以下错误:
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
推荐答案
问题是async
是python 3.7中的关键字
解决方案非常简单.
The problem is that async
is a keyword in python 3.7
the solution is quite simple.
只需将文件 async.py 重命名为 asyncn.py 之类的文件,然后替换文件 firebase.py 中的每个from .async import process_pool
, decorators.py 和其他from .asyncn import process_pool
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
这篇关于尝试导入Firebase程序包时收到.async错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!