question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no attribute 'OWM'

See original GitHub issue

What’s wrong? At start of the code the error jumps out. I am writing using Thonny. I work on raspberry pi 3 b +. thonny error: Traceback (most recent call last): File "/home/pi/pyowm.py", line 1, in <module> import pyowm File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _custom_import module = self._original_import(*args, **kw) File "/home/pi/pyowm.py", line 3, in <module> owm = pyowm.OWM('194277e0479d5a36ebb28e1a81c18006') AttributeError: module 'pyowm' has no attribute 'OWM'

terminal error: Traceback (most recent call last): File "pyowm.py", line 1, in <module> import pyowm File "/home/pi/pyowm.py", line 3, in <module> owm = pyowm.OWM('194277e0479d5a36ebb28e1a81c18006') AttributeError: 'module' object has no attribute 'OWM' code: `import pyowm

owm = pyowm.OWM(‘194277e0479d5a36ebb28e1a81c18006’)

observation = owm.weather_at_place(‘London,GB’) w = observation.get_weather() print(w)`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
csparpacommented, Jul 26, 2019

@romaKadeta In the error msg you’ve posted, I can read:

ImportError: cannot import name 'OWM' from 'pyowm' (/home/pi/pyowm.py)

It looks like you’re running a script named pyowm.py of your own, which attempts to import the installed PyOWM library. So, the name of the script and of the library clash.

Try to rename your script to any other thing different than “pyowm.py” and check if it works fine… Let me know!

0reactions
tikkycommented, Nov 18, 2019

I had similar issue. I am not sure what was causing the problem, but I’ve tried:

sudo apt-get update
sudo apt-get upgrade

and then I’ve uninstalled packages via:

sudo pip uninstall pyowm
sudo pip3 uninstall pyowm

and then installed back again for Python3 sudo pip3 install pyowm

After that the same script works fine for me without error message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'OWM' object has no attribute 'weather_at_place'` · Issue #313 ...
From the short part of code that is visible in the error message it appears that you're missing a step to call 'weather_at_place'...
Read more >
PyOWM No attribute - python - Stack Overflow
Have you installed the latest version of PyOwm? If yes, uninstall it, and install the previous version using the following command:.
Read more >
Frequently Asked Questions - pyowm documentation
AttributeError: 'OWM25' object has no attribute 'xxx'¶ ... This happens because you are not running PyOWM v3 and this is because your code...
Read more >
pyowm Documentation - Read the Docs
AttributeError: 'OWM25' object has no attribute 'xxx'. Your code looks like: >>> from pyowm import OWM. >>> owm = OWM('your-api-key-here').
Read more >
Schema Concepts - Vaticle
We use define to add new entities, relations, attributes and rules to the schema. ... By doing so, we are indicating that no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found