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

Installation problems on raspberry pi #105

Open
pho2Github opened this issue Feb 25, 2023 · 1 comment
Open

Installation problems on raspberry pi #105

pho2Github opened this issue Feb 25, 2023 · 1 comment

Comments

@pho2Github
Copy link

TapoP100 works fine on my windows PC using spyder.
Installing the package on my raspberry TapoP100 was only successful using "pip3" / "python3".
Trying to use TapoP100 then leads to the following error message:

Traceback (most recent call last):
  File "TPLink_P115_Auslesen.py", line 8, in <module>
    from PyP100 import PyP110
  File "/home/pi/.local/lib/python3.5/site-packages/PyP100/PyP110.py", line 12
    URL = f"http:\\{self.ipAddress}\app?token={self.token}"
                                                          ^
SyntaxError: invalid syntax

I also tried to see what happens if I could fix this error (without realy fixing it). I then run into the next error:

Traceback (most recent call last):
  File "TPLink_P115_Auslesen.py", line 8, in <module>
    from PyP100 import PyP110
  File "/home/pi/.local/lib/python3.5/site-packages/PyP100/PyP110.py", line 1, in <module>
    from PyP100 import PyP100
  File "/home/pi/.local/lib/python3.5/site-packages/PyP100/PyP100.py", line 79
    decode: bytes = b64decode(key.encode("UTF-8"))
          ^
SyntaxError: invalid syntax

Any hind how to resolve this?

@Belvenix
Copy link

The problem lays in the python version. In the library you can see that the author is using f-string which are introduced in python 3.6 and on stack trace you see rpi uses python 3.5. So you have a couple of alternatives - either fork the repo and change from f"http:\\{self.ipAddress}\app?token={self.token}" string into "http:\\{}\app?token={}".format(self.ipAddress, self.token) and in other places as well if you can only use 3.5 or upgrade python version or just copy the request calls to your own python and work from there.

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

No branches or pull requests

2 participants