我面临一个奇怪的问题。首先,我尝试安装Pyrebase。它已成功安装。至少在pip3 list
中显示。但是,当我运行包含{p>的文件database.py
时
import pyrebase
我得到了错误:
Traceback (most recent call last):
File "database.py", line 1, in <module>
import pyrebase
ModuleNotFoundError: No module named 'pyrebase'
然后,我尝试使用python-firebase。我再次面临同样的问题。安装成功;在pip3 list
中显示,但是我再次遇到找不到模块错误。有人可以帮我解决这个问题吗?
编辑
python3 -m site
提供以下输出:
sys.path = [
'/home/ankit',
'/home/ankit/anaconda3/lib/python37.zip',
'/home/ankit/anaconda3/lib/python3.7',
'/home/ankit/anaconda3/lib/python3.7/lib-dynload',
'/home/ankit/.local/lib/python3.7/site-packages',
'/home/ankit/anaconda3/lib/python3.7/site-packages',
]
USER_BASE: '/home/ankit/.local' (exists)
USER_SITE: '/home/ankit/.local/lib/python3.7/site-packages' (exists)
ENABLE_USER_SITE: True
答案 0 :(得分:-2)
尝试:
from firebase import firebase