Closed JerryTheQuad closed 3 years ago
@JerryTheQuad I think this is due to the fact that you don't have PyOWM installed on those environments! Can you check if PyOWM is among the installed third party libraries (remember that - of coures - it is not part of the Python standard library!)
Also please notice I've patched your code snippet so that your API key is now masked... NEVER expose your API secrets! This is a public repository! ;-)
Let me know
@JerryTheQuad consider changing pyowm.exceptions
to pyowm.commons.exceptions
@JerryTheQuad I think this is due to the fact that you don't have PyOWM installed on those environments! Can you check if PyOWM is among the installed third party libraries (remember that - of coures - it is not part of the Python standard library!)
Also please notice I've patched your code snippet so that your API key is now masked... NEVER expose your API secrets! This is a public repository! ;-)
Let me know
Wow, thank you for responding!) I checked on Repl.it and pyOWM is installed as a third-party package. Here is a screenshot. As an aside note, the code works fine on Google Collab. Have a great day!)
Hi @JerryTheQuad sorry I've missed it: FabianReister posted the solution, please check his comment
It's an import error: you're importing from the wrong path, as the exceptions module is not in the root path of the project.
Hi @JerryTheQuad sorry I've missed it: FabianReister posted the solution, please check his comment
It's an import error: you're importing from the wrong path, as the exceptions module is not in the root path of the project.
Thank you!) Just did that, this is what I get now:
Traceback (most recent call last): File "main.py", line 6, in <module> owm = OWM('xxxxxxxxxxxxxxxxxxxxxxxxxxx', language='en') TypeError: __init__() got an unexpected keyword argument 'language'
That's because you're intializing the library the wrong way.
Take a look at pyowm documentation about it:
https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html#language-setting
That should fix the language issue
That's because you're intializing the library the wrong way.
Take a look at pyowm documentation about it:
https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html#language-setting
That should fix the language issue
That's because you're intializing the library the wrong way.
Take a look at pyowm documentation about it:
https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html#language-setting
That should fix the language issue
Thank you, it really solved the language problem)
Hi,
Here is my code. It's a Telegram bot I created to show weather. In Google Collab it works OK, but in PythonAnywhere or Repl.it it shows this:
The actual code: