N
N
Nazar Ambrozyak2021-05-01 21:01:52
HTML
Nazar Ambrozyak, 2021-05-01 21:01:52

Why can't it find the installed module?

It throws an error ModuleNotFoundError: No module named 'pyowm' , although if you enter the pip freeze
command on the command line, then it is installed there. If that module is pyOWM. It does not work in any way - when I write the code itself, when I copy the checked one.

from pyowm import OWM
from pyowm.utils import config
from pyowm.utils import timestamps

owm = OWM('b4e110361293b3397e19afebc4ffeb91')
mgr = owm.weather_manager()


# Search for current weather in London (Great Britain) and get details
observation = mgr.weather_at_place('London,GB')
w = observation.weather

w.detailed_status         # 'clouds'
w.wind()                  # {'speed': 4.6, 'deg': 330}
w.humidity                # 87
w.temperature('celsius')  # {'temp_max': 10.5, 'temp': 9.7, 'temp_min': 9.0}
w.rain                    # {}
w.heat_index              # None
w.clouds                  # 75

# Will it be clear tomorrow at this time in Milan (Italy) ?
forecast = mgr.forecast_at_place('Milan,IT', 'daily')
answer = forecast.will_be_clear_at(timestamps.tomorrow())

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2018-09-24
@Tak_UA

TypeError: $(...).offset(...) is undefined
Downstream scripts are no longer loaded

M
Maxim Sagaydak, 2021-05-01
@CoDeR2006

Make sure pyowm is installed in the same space where the script is run from

D
denizen, 2021-05-02
@denizen

I strongly recommend that you read the current documentation for the modules you use. There, in plain text, they write how to initialize correctly:
from pyowm.owm import OWM

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question