Forum

Einloggen | Registrieren | RSS  

luemar(R)

07.01.2018,
13:53
 

Raspberry: installieren von pushbullet (Computertechnik)

Sehr geehrte Experten,
Versuche mittels pushbullet ein SMS von meinem Raspberry
Pi (Debian Jessie) an mein Smartphoen zu senden.
Pushbullet App erfolgreich installier, Access Token erhalten.

Nach pip Installation von websock-client, requests und python-magic
und nach Installation von pushbullet mit
>sudo git clone https://github.com/Azelphur/pyPushBullet

bekomme ich in meinem Script (s.u.) jedesmal den Fehler:

>>> import pushbullet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pushbullet.py", line 4, in <module>
from pushbullet import PushBullet
ImportError: cannot import name PushBullet

Habe auf verschiedensten Websites kein Lösung gefunden.
Besten dank für hilfreiche Kommentare, luemar.

Mein Script (an PIN 23 liegt ein PIR):
#!/usr/bin/python3
import RPi.GPIO as GPIO
import sys, time
from pushbullet import PushBullet

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)

api_key = "mein Access Token"
pb = pushbullet(api_key)

def melder(pin):
zeit = time.strftime('%d.%m.%Y %H:%M:%S')
devices = pb.getDevices()
pb.pushNote(devices[0]["iden"], 'Testmeldung PIR 2', zeit)
time.sleep(8)
try:
GPIO.add_event_detect(23, GPIO.RISING)
GPIO.add_event_callback(23, melder)

except KeyboardInterrupt:
print('EndeProgram')
GPIO.cleanup()

bastelix(R)

07.01.2018,
20:15

@ luemar

Raspberry: installieren von pushbullet

» Nach pip Installation von websock-client, requests und python-magic
» und nach Installation von pushbullet mit
» >sudo git clone https://github.com/Azelphur/pyPushBullet
Warum hast du das Repository geklont (und vor allem whoin)?

In der Readme steht "If you install pyPushBullet via pip install git+https://github.com/Azelphur/pyPushBullet.git the dependencies should be install automatically."
Versuch mal

pip install git+https://github.com/Azelphur/pyPushBullet.git

dann sollte die Lib auch in einem Verzeichnis liegen das Python nach Libs durchsucht.
Am besten findest du dann noch heraus wo du das Repository hin geklont hast (der Ordner müsste pyPhushBullet heißen) und löst den Ordner zur Sicherheit.