varun9597
Posts: 3
Joined: Sun Feb 17, 2019 4:33 am

Import Error: No module named Firebase.

Sat Feb 23, 2019 12:37 pm

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.

gordon77
Posts: 4689
Joined: Sun Aug 05, 2012 3:12 pm

Re: Import Error: No module named Firebase.

Sat Feb 23, 2019 2:39 pm

Are you running python or Python3?

LeLegendS
Posts: 1
Joined: Mon Apr 15, 2019 10:14 am

Re: Import Error: No module named Firebase.

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.

klricks
Posts: 6854
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Import Error: No module named Firebase.

Mon Apr 15, 2019 12:18 pm

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?
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

EagleLoid
Posts: 1
Joined: Sun Jan 12, 2020 1:32 am

Re: Import Error: No module named Firebase.

Sun Jan 12, 2020 1:43 am

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.

User avatar
paddyg
Posts: 2501
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Import Error: No module named Firebase.

Sun Jan 12, 2020 11:14 am

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?
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
neilgl
Posts: 1663
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Import Error: No module named Firebase.

Sun Jan 12, 2020 12:17 pm

Maybe it should be

Code: Select all

from firebase import firebase
not

Code: Select all

from firebase import Firebase

User avatar
paddyg
Posts: 2501
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Import Error: No module named Firebase.

Sun Jan 12, 2020 2:34 pm

@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)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”