1

I want to connect to firebase on replit using python. I'm using the code below:

from firebase import firebase

firebase = firebase.FirebaseApplication("my firebase url", None)

data = {
  'ddfjaklfbja': 'dklabja;kdlf',
  'adfjlkgadjf': 'dkaljbaowq',
  'afbiouadofpia': 'dsajklbjanzm'
}

result = firebase.post('/test1', data)
print(result)

However, when I try to run it, it returns an error saying that there is no module named urllib3:

ModuleNotFoundError: No module named 'urllib3'

When I try to use the packages tab to install it on the left, it does not install and returns with the same error (there are multiple lines but the last line says this). How can I fix it?

enter image description here enter image description here

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
CELLSecret
  • 139
  • 1
  • 9

2 Answers2

0

Their are multiple things you can try:

  1. Open your command prompt and enter "pip install urllib3"
  2. If it can't install it try this: python3 -m pip install urllib3 or pip3 install urllib3
  3. Perhaps it helps when you add this to your python file: import urllib3
tuurtje11
  • 189
  • 1
  • 8
  • I don't think replit recognizes pip install as it already installed most of the packages. (returns error `SyntaxError: invalid syntax`) – CELLSecret Feb 24 '22 at 06:44
0

this issue is related to Python path, and with the python interpreter. Make sure you are using the python interpreter in which you have installed the modules. (If using 3.9 use python 3.9 as interpreter as opposed to 3.10). If this doesnt work check python path. Other easy solution is to change your project folder to one that imported your modules correctly.