Frage zu https://github.com/zhulik/aiotractive

Python auf Einplatinencomputer wie Raspberry Pi, Banana Pi / Python für Micro-Controller
Antworten
raspiklaus1
User
Beiträge: 2
Registriert: Samstag 18. November 2017, 11:47

Hallo,

ich würde gerne den Code von https://github.com/zhulik/aiotractive auf meinem RasPi zum Laufen kriegen.

Was habe ich gemacht

pi@raspberrypi:/opt/aiotractive-main/aiotractive $ pip install aiotractive
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting aiotractive
Using cached https://files.pythonhosted.org/packages ... 5.1.tar.gz
Installing build dependencies ... done
Collecting aiohttp>=3.7.4 (from aiotractive)
Could not find a version that satisfies the requirement aiohttp>=3.7.4 (from aiotractive) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2)
No matching distribution found for aiohttp>=3.7.4 (from aiotractive)

pi@raspberrypi:/opt/aiotractive-main/aiotractive $ pip3 install aiotractive
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: aiotractive in /usr/local/lib/python3.7/dist-packages (0.5.1)
Requirement already satisfied: aiohttp>=3.7.4 in /home/pi/.local/lib/python3.7/site-packages (from aiotractive) (3.7.4.post0)
Requirement already satisfied: yarl>=1.6.3 in /home/pi/.local/lib/python3.7/site-packages (from aiotractive) (1.6.3)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /home/pi/.local/lib/python3.7/site-packages (from aiohttp>=3.7.4->aiotractive) (3.0.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/pi/.local/lib/python3.7/site-packages (from aiohttp>=3.7.4->aiotractive) (5.1.0)
Requirement already satisfied: chardet<5.0,>=2.0 in /usr/lib/python3/dist-packages (from aiohttp>=3.7.4->aiotractive) (3.0.4)
Requirement already satisfied: typing-extensions>=3.6.5 in /home/pi/.local/lib/python3.7/site-packages (from aiohttp>=3.7.4->aiotractive) (3.10.0.0)
Requirement already satisfied: attrs>=17.3.0 in /home/pi/.local/lib/python3.7/site-packages (from aiohttp>=3.7.4->aiotractive) (21.2.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl>=1.6.3->aiotractive) (2.6)
pi@raspberrypi:/opt/aiotractive-main/aiotractive $


pi@raspberrypi:/opt/aiotractive-main/aiotractive $ pip3 list
Package Version
----------------- -----------
aiohttp 3.7.4.post0
aiotractive 0.5.1
asn1crypto 0.24.0
astroid 2.1.0
asttokens 1.1.13
async-timeout 3.0.1
asyncio 3.4.3
attrs 21.2.0
automationhat 0.2.0
beautifulsoup4 4.7.1
blinker 1.4
blinkt 0.1.2
buttonshim 0.0.2
Cap1xxx 0.1.3
certifi 2018.8.24
chardet 3.0.4
Click 7.0
colorama 0.4.4
colorzero 1.1
cookies 2.2.1
cryptography 2.6.1
cupshelpers 1.0
decorator 4.3.0
deepspeech 0.9.3
docutils 0.14
drumhat 0.1.0
entrypoints 0.3
envirophat 1.0.0
ExplorerHAT 0.4.2
Flask 1.0.2
fourletterphat 0.1.0
gpiozero 1.5.1
halo 0.0.31
html5lib 1.0.1
idna 2.6
isort 4.3.4
itsdangerous 0.24
jedi 0.13.2
Jinja2 2.10
keyring 17.1.1
keyrings.alt 3.1.1
lazy-object-proxy 1.3.1
log-symbols 0.0.14
logilab-common 1.4.2
lxml 4.3.2
MarkupSafe 1.1.0
mccabe 0.6.1
microdotphat 0.2.1
mote 0.0.4
motephat 0.0.3
multidict 5.1.0
mypy 0.670
mypy-extensions 0.4.1
numpy 1.16.2
oauthlib 2.1.0
olefile 0.46
pantilthat 0.0.7
parso 0.3.1
pexpect 4.6.0
pgzero 1.2
phatbeat 0.1.1
pianohat 0.1.0
picamera 1.13
piglow 1.2.5
pigpio 1.78
Pillow 5.4.1
pip 18.1
psutil 5.5.1
PyAudio 0.2.11
pycairo 1.16.2
pycrypto 2.6.1
pycups 1.9.73
pygame 1.9.4.post1
Pygments 2.3.1
PyGObject 3.30.4
pyinotify 0.9.6
PyJWT 1.7.0
pylint 2.2.2
pyOpenSSL 19.0.0
pyserial 3.4
pysmbc 1.0.15.6
python-apt 1.8.4.3
pyxdg 0.25
rainbowhat 0.1.0
reportlab 3.5.13
requests 2.21.0
requests-oauthlib 1.0.0
responses 0.9.0
roman 2.0.0
RPi.GPIO 0.7.0
RTIMULib 7.2.1
scipy 1.1.0
scrollphat 0.0.7
scrollphathd 1.2.1
SecretStorage 2.3.1
Send2Trash 1.5.0
sense-hat 2.2.0
setuptools 40.8.0
simplejson 3.16.0
six 1.12.0
skywriter 0.0.7
sn3218 1.2.7
soupsieve 1.8
spidev 3.4
spinners 0.0.24
ssh-import-id 5.7
termcolor 1.1.0
thonny 3.3.6
touchphat 0.0.1
twython 3.7.0
typed-ast 1.3.1
typing-extensions 3.10.0.0
unicornhathd 0.0.4
urllib3 1.24.1
webencodings 0.5.1
webrtcvad 2.0.10
Werkzeug 0.14.1
wheel 0.32.3
wrapt 1.10.11
yarl 1.6.3


pi@raspberrypi:/opt/aiotractive-main/aiotractive $ cat ./test.py
import asyncio

from aiotractive import Tractive

async def main():
async with Tractive("meine email", "mein password") as client:
# interact with the client here
pass

if __name__ == "__main__":
asyncio.run(main())

pi@raspberrypi:/opt/aiotractive-main/aiotractive $ python3 ./test.py
Traceback (most recent call last):
File "./test.py", line 3, in <module>
from aiotractive import Tractive
File "/usr/local/lib/python3.7/dist-packages/aiotractive/__init__.py", line 1, in <module>
from .tractive import Tractive # noqa
File "/usr/local/lib/python3.7/dist-packages/aiotractive/tractive.py", line 4, in <module>
from .channel import Channel
File "/usr/local/lib/python3.7/dist-packages/aiotractive/channel.py", line 4, in <module>
from asyncio.exceptions import TimeoutError as AIOTimeoutError
ModuleNotFoundError: No module named 'asyncio.exceptions'


Was habe ich falsch gemacht?
es wäre nett wenn mir einer einen Tipp geben könnte.

Danke


Klaus
narpfel
User
Beiträge: 643
Registriert: Freitag 20. Oktober 2017, 16:10

Moin,

das erste Installieren (mit `pip`) hat nicht funktioniert, weil `pip` für Python 2 ist.

Der ImportError von `asyncio.exceptions` kommt daher, dass es `asyncio.exceptions` erst seit Python 3.8 gibt.

Das ist an der Stelle allerdings vollkommen unnötig, da `asyncio.exceptions` zu importieren, weil man `TimeoutError` genauso gut aus `asyncio` importieren kann. Dieser „Fehler“ wurde in diesem Commit eingebaut.

Da das Paket sagt, dass es Python 3.7 unterstützt, würde ich da einen Bug-Report (oder besser PR) schreiben. Am besten gleich noch das CI-Setup so erweitern, dass auch auf Python 3.7 und Python 3.8 getestet wird. ;-)

Edit: Und bitte setze Code und Tracebacks in Codeblöcke, damit die Einrückung nicht kaputt geht und man das lesen kann.
raspiklaus1
User
Beiträge: 2
Registriert: Samstag 18. November 2017, 11:47

Hallo,

Tausend Dank für deine Hilfe.

Kannst du mir bitte auch noch einen Beispiel-Code geben, wie ich Daten von Tractive zurückbekommen kann und in eine Datei schreiben kann?

Wie kann ich bitte die Daten von einem Tracker abholen, z. B. den Ladezustand?

Wie kann ich bitte die Positions Daten von dem Tracker abholen?

Danke

Gruss

Klaus
Antworten