firebase=firebase(config) TypeError: 'module' object is not callable

Viewed 365

Traceback (most recent call last): File "C:/Users/myprofile/Documents/firebase tests.py", line 9, in firebase=firebase(config) TypeError: 'module' object is not callable

I am getting this error in IDLE when I run this code.

from firebase import firebase
    
config = {
    "apiKey": "apiKey",
    "authDomain": "projectId.firebaseapp.com",
    "databaseURL": "https://databaseName.firebaseio.com",
    "storageBucket": "projectId.appspot.com"
}
    
firebase = firebase(config)

Any help would be appreciated. Python : 3.8

1 Answers

The reason you're getting this error is because python is thinking firebase(config) is referring to the package itself, instead of the Firebase object within that package.

To fix this, just change from firebase import firebase to from firebase import Firebase and firebase = firebase(config) to firebase = Firebase(config).

Related