csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
789 stars 171 forks source link

AttributeError: 'OWM25' object has no attribute 'weather_manager' #366

Closed neiry closed 3 years ago

neiry commented 3 years ago

AttributeError: 'OWM25' object has no attribute 'weather_manager' help python 3,7 dont work thk you all

geofbaum commented 3 years ago

Looks like you're not using pyowm v3. You need to upgrade to the new version.

https://pyowm.readthedocs.io/en/latest/v3/faq.html?highlight=Owm25#attributeerror-owm25-object-has-no-attribute-xxx

neiry commented 3 years ago

Looks like your not using pyowm v3. You need to upgrade to the new version.

https://pyowm.readthedocs.io/en/latest/v3/faq.html?highlight=Owm25#attributeerror-owm25-object-has-no-attribute-xxx

pyowm update 3.1.1.

geofbaum commented 3 years ago

Do you still have a version of 2.5 installed in your python environment though? It's obviously finding a version of 2.5 somewhere or else you wouldn't see that error. So when you updated to v3+ did you have a copy of the old version that wasn't uninstalled? If you can confirm that you never had a version of pyowm installed before v3 then we could work from there.

neiry commented 3 years ago

Do you still have a version of 2.5 installed in your python environment though? It's obviously finding a version of 2.5 somewhere or else you wouldn't see that error. So when you updated to v3+ did you have a copy of the old version that wasn't uninstalled? If you can confirm that you never had a version of pyowm installed before v3 then we could work from there.

I completely removed the entire python of the old version. only 3+left

csparpa commented 3 years ago

@neiry looks like this is not the first time this happens:

https://github.com/csparpa/pyowm/issues?q=is%3Aissue+weather_manager

This is clearly, as @geofbaum said, due to the fact that you're using a legacy PyOWM version - this is because PyOWM versions prior to 3 do not feature wather_manager objects

So you just need to find out that old version and replace it with a new one. Try to debug where your current Python interpreter reads in terms of libraries (aka your PYTHONPATH), or - if it's not too much hassle - just avoid any debugging and start out with a fresh environment