Open danst0 opened 7 years ago
Das Projekt weatherbot verwendet nicht das per pip3
installierbare pyowm
, sondern ein eigenes Modul mit gleichem Namen. Vielleicht sollte ich das mal in pyowm-micro umbenennen; so heißt schließlich auch das Repository.
Ok. Installiert. Jetzt fehlte mir noch ein Beispiel für die config json. Insbesondere
"openweathermap": {"api_key": "xxxxxx", ???}
config.json-Beispiel:
{
"telegram_bot_token": "...",
"timeout_secs": 3600,
"authorized_users": [ 123456787, 123456789 ],
"openweathermap": {
"city_list": "./pyowm/city.list.reduced.json.bz2",
"api_key": "0123456789abcdef..."
},
"verbose": true
}
authorized_users
: Liste der Telegram-IDs, die den Bot nutzen dürfen
telegram_bot_token
: Telegram API Key
openweathermap/api_key
: OWM API Key
Danke für die schnelle Hilfe. Ich habe die city.lists aus dem pyowm-micro jetzt in das pyowm-Verzeichnis des Bots kopiert. Das Entpacken scheint noch nicht zu funktionieren...
pi@kirby ~/weatherbot ❯❯❯ ls pyowm city.de.list.reduced.json.bz2 city.list.reduced.json.bz2
pi@kirby ~/weatherbot ❯❯❯ ./weatherbot.py Traceback (most recent call last): File "./weatherbot.py", line 350, in <module> main() File "./weatherbot.py", line 329, in main lambda p: print('\rLoading city list ... {:d}%'.format(p), end='', flush=True)) File "/usr/local/lib/python3.4/dist-packages/pyowm_micro-1.0.3-py3.4.egg/pyowm/city.py", line 119, in read File "/usr/lib/python3.4/bz2.py", line 365, in readlines return io.BufferedIOBase.readlines(self, size) File "/usr/lib/python3.4/bz2.py", line 351, in readline return io.BufferedIOBase.readline(self, size) File "/usr/lib/python3.4/bz2.py", line 276, in peek if not self._fill_buffer(): File "/usr/lib/python3.4/bz2.py", line 218, in _fill_buffer self._buffer = self._decompressor.decompress(rawblock) OSError: Invalid data stream
Hallo,
ich habe pyowm per pip3 installiert.
from pyowm.city import CityList
führt zu
ImportError: cannot import name 'CityList'
Daniel