3NiGMa
3NiGMa

Reputation: 545

no module named pyrebase?

i have been trying to access my firebase DB through a python program on my rapberry pi 3, but i have been encountering the same import error

File "/home/pi/Desktop/testFB.py", line 1, in <module>
import pyrebase
ImportError: No module named 'pyrebase'

Here is the code

 import pyrebase

    config = {
      "apiKey": "apikey",
      "authDomain": "db.firebaseapp.com",
      "databaseURL": "https://db.firebaseio.com/",
      "storageBucket": "db.appspot.com"
    }
firebase = Pyrebase.initialize_app(config)
db=firebase.database()
print(db.get())

upon running 'pip3 list', 'Pyrebase==3.0.27' is in there

but in the file /usr/lib/python3.5 (where the rest of my modules are) Pyrebase.py is not there?

any help is appreciated, although similar questions have solutions that have not been working for me... thanks in advance, 3NiGMa

Upvotes: 1

Views: 3827

Answers (2)

Nand kishor kumar
Nand kishor kumar

Reputation: 1

Rolling back uninstall of pycryptodome Moving to c:\users\hitman\appdata\local\programs\python\python38-32\lib\site-packages\crypto
from C:\Users\Hitman\AppData\Local\Programs\Python\Python38-32\Lib\site-packages~rypto Moving to c:\users\hitman\appdata\local\programs\python\python38-32\lib\site-packages\pycryptodome-3.9.8.dist-info
from C:\Users\Hitman\AppData\Local\Programs\Python\Python38-32\Lib\site-packages~ycryptodome-3.9.8.dist-info

Upvotes: 0

Frieder
Frieder

Reputation: 1266

You have either not installed the module or the path where the module is installed is not included in your current python PATH.

I recommend to use pip to install all modules.

pip install pyrebase

You can show your include paths with:

python -c "import sys; print('\n'.join(sys.path))"

Can you find your pyrebase folder in those paths? If not something is wrong with your config.

I also recommend that you use virtualenv, for more information see https://docs.python-guide.org/dev/virtualenvs/ as you can choose python interpreter version and depedencies for every project and you don't have to mix modules needed by other projects. It also always creates a clean state for a new project.

Upvotes: 1

Related Questions