ozgur / python-firebase

Python interface to the Firebase's REST API
http://ozgur.github.com/python-firebase/
MIT License
593 stars 155 forks source link

Python 2.7.9 ImportError: cannot import name firebase #36

Closed MasterKale closed 9 years ago

MasterKale commented 9 years ago

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?

MasterKale commented 9 years ago

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?

MasterKale commented 9 years ago

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.

avneesh91 commented 9 years ago

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

nguyenngocthanh commented 8 years ago

@avneesh91 I get the same error to you. I try cleaning the pyc file and rename the py file, then it worked fine.

GharsallaouiNader commented 8 years ago

just not use firebase.py as a name for your project and it will work

archit1012 commented 7 years ago

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...

MahendraBilagi commented 7 years ago

I renamed firebase.py to some other name... Its working :+1:

nomanzia007 commented 6 years ago

i have also same error No module name is firebase. please help me..

DavidSilTroy commented 5 years ago

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 :)

thilipr commented 5 years ago

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'

suhaibkhan916 commented 2 years ago

I tried to import the firebase package in my project.

  1. There are no files that name as firebase.py or anything related.
  2. I have created a new project and imported the same package in the hello world programme, still gave me that error.
  3. 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.
  4. I had the issue on 3.0.1, 3.0.0 versions and 2.2.0 worked for me.
  5. you can try one by one and it will work