BeatsuDev / tibber.py

An UNOFFICIAL python wrapper for the nordic electricity company Tibber's API.
MIT License
17 stars 2 forks source link

[BUG] moduel not found #18

Closed cycl0ne closed 1 year ago

cycl0ne commented 1 year ago

Tried to install it on a synology nas with python 3.8: Traceback (most recent call last): File "TibberApiTest.py", line 2, in import tibber File "/volume1/Python/python-env/lib/python3.8/site-packages/tibber/init.py", line 7, in from tibber.enums import Resolution ModuleNotFoundError: No module named 'tibber.enums'

-- Any dependencies? On windows it worked out of box.

BeatsuDev commented 1 year ago

Have you checked if it's the latest version of tibber (0.1.1)? You can check by running pip show tibber.py The enums subpackage is something I removed in an earlier version I believe...

cycl0ne commented 1 year ago

hmm you are right. it says: 0.0.1

but when i do a pip install tibber.py i get: Requirement already satisfied: tibber.py in ./python-env/lib/python3.8/site-packages (0.0.1)

Ahh i found it.. you do require something: ERROR: Ignored the following versions that require a different python version: 0.0.2rc0 Requires-Python >=3.9.0; 0.0.3rc0 Requires-Python >=3.9.0; 0.0.4 Requires-Python >=3.9.0; 0.1.0 Requires-Python >=3.9.0; 0.1.1 Requires-Python >=3.9.0 ERROR: Could not find a version that satisfies the requirement tibber.py==v0.1.1 (from versions: 0.0.1) ERROR: No matching distribution found for tibber.py==v0.1.1

Since synology uses python3.8.. need to see how i can upgrade it.

BeatsuDev commented 1 year ago

Yes. I actually was in the process of rewriting the code so that it supports Python 3.8 and 3.7 too. The problem is that I use

@property
@classmethod
def method():
   ...

which for some reason is not supported in versions prior to Python 3.9.

So to answer the issue, you either need to upgrade to Python 3.9 or wait for a rewrite (which might take a little while). Thanks for bringing up the issue! I'll close this issue soon if there's nothing else to add.

cycl0ne commented 1 year ago

you can close it.. i try to google up to use 3.9 on synology.. default is 3.8.