Page 1 of 1

Import Error: No module named Firebase.

Posted: Sat Feb 23, 2019 12:37 pm
by varun9597
I want to use Firebase in my RaspberryPi 3B+. I have successfully installed python-firebase in raspberry pi and can see the folder along with "firebase.py" file in -- "/usr/local/lib/python3.5/dist-packages".

While I am trying to send data from my python script to Firebase. I am facing the following issue.

Code: Select all

Traceback (most recent call last): 
  File "test2.py", line 2, in <module>
  from firebase import firebase
ImportError: No module named firebase
Please help.

Re: Import Error: No module named Firebase.

Posted: Sat Feb 23, 2019 2:39 pm
by gordon77
Are you running python or Python3?

Re: Import Error: No module named Firebase.

Posted: Mon Apr 15, 2019 10:20 am
by LeLegendS
Hi, i would like to update this thread. I'm also facing this issue. Any workaround to fix this? I've tried installed $ sudo pip install firebase-admin but returns errors.

Re: Import Error: No module named Firebase.

Posted: Mon Apr 15, 2019 12:18 pm
by klricks
LeLegendS wrote:
Mon Apr 15, 2019 10:20 am
Hi, i would like to update this thread. I'm also facing this issue. Any workaround to fix this? I've tried installed $ sudo pip install firebase-admin but returns errors.
Are you using python 2 (python) -OR- python 3?

Re: Import Error: No module named Firebase.

Posted: Sun Jan 12, 2020 1:43 am
by EagleLoid
I'm having the same issue.
I'll go through the very beginning
I install pip3 through

Code: Select all

sudo apt install python3-pip
I install firebase through

Code: Select all

sudo pip3 firebase
I insert my script into
/home/pi/testScript.py
I try running my script as

Code: Select all

sudo python3 testScript.py
result :

Code: Select all

Traceback (most recent call last):
  File "testScript.py", line 3, in <module>
    from firebase import Firebase
ModuleNotFoundError: No module named 'firebase'
Yet when use pip3 list I will get firebase as one of the packages.
So I have no idea what I'm missing.

Re: Import Error: No module named Firebase.

Posted: Sun Jan 12, 2020 11:14 am
by paddyg
does everything need to be run as root (that often causes problems)? Better to "pip3 install firebase --user" which prompts the next question. Did you actually have "install" in your pip3 command? It's missing from your description of what you did. What messages did you get on screen after you installed firebase? Did it all look to go swimmingly? Sometimes there are several pages of info with pip3 install and a critical message giving a clue might have gone off the top of the page. Try it again "pip3 install firebase --upgrade --user" (or your "sudo pip3 install firebase --upgrade" if everything has to be run as root for some reason I'm not aware of)

EDIT - I see you say "pip3 list" gives firebase as a package so maybe my previous suggestion isn't relevant (sudo still might be an issue). You don't have a file called firebase.py in the same folder (or somewhere in sys.path) that might be being loaded instead of the module?

Re: Import Error: No module named Firebase.

Posted: Sun Jan 12, 2020 12:17 pm
by neilgl
Maybe it should be

Code: Select all

from firebase import firebase
not

Code: Select all

from firebase import Firebase

Re: Import Error: No module named Firebase.

Posted: Sun Jan 12, 2020 2:34 pm
by paddyg
@neilgl yes that looks to be the case - still odd that the error isn't can't import name 'Firebase'. Still it would be sensible to open a python terminal and try a few imports etc.
>>> import firebase
>>> dir(firebase)