Mart Hagedoorn
Mart Hagedoorn

Reputation: 90

ImportError: No module named 'pyrebase'

I'm currently working on a project with my raspberry pi. In this project I want to connect my raspberry to google firebase, therefore I have to use:

import pyrebase

I have installed pyrebase in terminal with:

pip install pyrebase

Also I'm aware that pyrebase doesn't support python 2, so i'm using python 3.4.2. I don't know why python can't find it, any ideas or suggestions?

Upvotes: 2

Views: 28393

Answers (10)

leo
leo

Reputation: 113

My issue was that I had two different Pythons installed. I installed Pyrebase in one Python, but VSCode was using the Python that didn't have Pyrebase

  1. install Pyrebase4 as pip3 install Pyrebase4
  2. then check where it's installed. mine is installed in:
/Users/Leo/Library/Python/3.9/lib/python/site-packages/pyrebase
  1. then select the right Python: enter image description here

Upvotes: 0

Sathappan PR
Sathappan PR

Reputation: 31

This will work on latest versions of python

pip install pyrebase4 

Upvotes: 2

Aziz
Aziz

Reputation: 55

For some reasons pyrebase Lib will only works in pycharm ide.

donwload Pycharm IDE Here !

1- Start Clean:

pip3 uninstall pyrebase4

pip3 uninstall pyrebase

2- Install Lib

pip3 install pyrebase

3- Restart your PC.

4- Run pycharm ide as administrator

5- Import it in Python:

from pyrebase import pyrebase

You should have it to work now!

Upvotes: 0

ali vargas
ali vargas

Reputation: 11

pip3 install pyrebase4 

if this doesn't work write this:

pip install pycryptodome

then

pip install pyrebase

Upvotes: 1

Shubham Kulkarni
Shubham Kulkarni

Reputation: 1

I was getting the "import error" of pyrebase. After checking this link I got the idea of problem, but was unable to find proper solution. After struggling for a day, I got the Solution. As I was using PYREBASE for my Engineering Project, I re-installed RASPBIAN-JESSIE stretch image on SD. Removed python2.7 and python3 and again installed python3 and then installing pyrebase and with frequent reboots. but it worked!

$ sudo apt-get remove python2.7

$ sudo apt-get remove python3

$ sudo reboot

$ sudo apt-get install python3

$ wget https://bootstrap.pypa.io/get-pip.py

$ sudo python3 get-pip.py

$ pip3 freeze      #(displays about 15 lines, if pip is installed correctly) 

$ pip3 list        #(displays about 15 lines)

$ sudo pip3 install pyrebase 

and now,

from pyrebase import pyrebase

and it did not gave import error.

Upvotes: 0

Mike Yang
Mike Yang

Reputation: 2934

pip install pyrebase <br>

This is for python 2.x
Please install python 3.x and pip3.x instead, then run

`pip3.x install pyrebase`

Upvotes: 0

Haris Zaheer
Haris Zaheer

Reputation: 3

The Best Option is to install Ubuntu Mate in your raspberry pi as i have tried this on debian and got the same problem for absolutely no reason!! so i installed ubuntu mate and here you go it worked!!

Upvotes: 0

importnumpyasnp
importnumpyasnp

Reputation: 262

If you have multiple versions of python installed, it may be confused on which version of pyrebase to install.

Try:

pip3 install pyrebase

Upvotes: 3

jhpg
jhpg

Reputation: 409

Try to import like this:

from pyrebase import pyrebase

Works for me.

Upvotes: 2

Oded BD
Oded BD

Reputation: 3276

Check if the pip you're using is working with your python version

pip --version
pip 8.1.2 from c:\python27\lib\site-packages (python 2.7)

Mine is working with python 2.7. If you're working with the right python version try pip freeze or pip list to see the list of currently installed libraries, and check if the one that you're trying to install is there.

Upvotes: 0

Related Questions