Python 2.7.9 ImportError: cannot import name firebase
Closed this issue ยท 11 comments
I just installed via pip python-firebase (and requests) into a brand new virtualenv running Python 2.7.9, yet when I try to use from firebase import firebase Python spits out the following error:
ImportError: cannot import name firebase
I know for a fact the module and its prereqs are installed because I can see them in the list of modules generated by help('modules')
I created this virtual environment after running into the same issue developing without a virtual environment (e.g. I was installing everything to the system's typical Python install). I figured I'd messed something up so I started over with a fresh virtual environment and used it exclusively when I was reinstalling my other dependencies.
Am I doing something wrong? Is Python 2 not supported?
Here's the traceback:
Traceback (most recent call last):
File "D:/Projects/gcalapi/cgi-bin/firebase_test.py", line 1, in <module>
from firebase import firebase
File "D:\Projects\gcalapi\cgi-bin\firebase.py", line 1, in <module>
ImportError: cannot import name firebase
Is it trying to load a non-existent firebase.py instead of python-firebase?
Nevermind, somehow a compiled bit of Python called firebase.pyc
had been generated some time while I was messing around and that was throwing things off. I deleted it and the import worked fine.
Hi,
I am getting the same error. I have installed python-firebase, but when i fire up the django dev server it throws import error on
from . import firebase
ImportError: cannot import name firebase
So I tried cleaning the pyc files as well, but this problem still persists
@avneesh91 I get the same error to you. I try cleaning the pyc file and rename the py file, then it worked fine.
just not use firebase.py as a name for your project and it will work
i already ran the project , it was working . restarted it and started giving
from firebase import firebase
ImportError: No module named firebase
in eclipse import does not show any error...
I renamed firebase.py to some other name... Its working ๐
i have also same error
No module name is firebase.
please help me..
Hi everyone, I haved the same problem and it's true.. you must rename "firebase.py" to some other name and delete all the "firebase.pyc" created..
I deleted almost 3 of them and then works :)
I also had a same problem
my code like this
from firebase import firebase
fb = firebase.FirebaseApplication('https://vehice-counter.firebaseio.com/', None)
fb.put('test/asdf',"count",4)
error:
Traceback (most recent call last):
File "C:/Users/Asus/PycharmProjects/firebase/firebase.py", line 1, in
from firebase import firebase
File "C:\Users\Asus\PycharmProjects\firebase\firebase.py", line 1, in
from firebase import firebase
ImportError: cannot import name 'firebase'
I tried to import the firebase package in my project.
- There are no files that name as firebase.py or anything related.
- I have created a new project and imported the same package in the hello world programme, still gave me that error.
- Just downgraded the firebase version to any (from versions: 1.0.0, 1.0.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 3.0.0, 3.0.1) and It will work.
- I had the issue on 3.0.1, 3.0.0 versions and 2.2.0 worked for me.
- you can try one by one and it will work