Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import RingEventListener #353

Open
JPAssoc opened this issue Mar 13, 2024 · 6 comments
Open

Can't import RingEventListener #353

JPAssoc opened this issue Mar 13, 2024 · 6 comments

Comments

@JPAssoc
Copy link

JPAssoc commented Mar 13, 2024

I've upgraded to Python 3.9 and installed the [listen] version of the doorbell package, but I'm still not able to import the required class. Here are the first few lines of my code:

#!/usr/bin/env python

import sys

print("Here we go, version is ", sys.version_info)

import json
import getpass
import time
import asyncio
import struct
import RPi.GPIO as GPIO
import logging
from pathlib import Path
from pprint import pprint
from ring_doorbell import Ring, Auth
from ring_doorbell.exceptions import RingError
from oauthlib.oauth2 import MissingTokenError
from ring_doorbell.const import DINGS_ENDPOINT
from ring_doorbell.listen import can_listen

if can_listen:
print("Can listen")
else:
print("Can't listen")

from ring_doorbell.listen import RingEventListener

This is what I see in my Raspberry Pi terminal:

Screenshot 2024-03-13 at 13 45 34

It's probably something really stupid that I'm doing, but I can't see it at the moment, and any help would be appreciated.

Jon

@sdb9696
Copy link
Collaborator

sdb9696 commented Mar 13, 2024

It looks like the listen extra has not installed. What do you see when you run pip freeze | grep firebase-messaging? You should see firebase-messaging==0.2.0.

Try to install again with pip install ring-doorbell[listen]==0.8.7 and look at the output to see if firebase-messaging is getting installed.

@JPAssoc
Copy link
Author

JPAssoc commented Mar 13, 2024

Thanks for the quick response. I think it's installed already:

Screenshot 2024-03-13 at 14 27 23

@sdb9696
Copy link
Collaborator

sdb9696 commented Mar 13, 2024

There maybe something corrupted in those installs or with some of the dependencies. Could you trying installing ring_doorbell from scratch in a new virtual environment and then see if you can import RingEventListener from a python prompt?

@JPAssoc
Copy link
Author

JPAssoc commented Mar 13, 2024

OK, I'll try that. Thanks.

@sdb9696
Copy link
Collaborator

sdb9696 commented Mar 21, 2024

Hi, did this work in a virtual env?

@JPAssoc
Copy link
Author

JPAssoc commented Mar 21, 2024

Sorry - got diverted to other stuff, so haven't yet had time to try this. Will let you know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants