johnwargo / pi-weather-station

Raspberry Pi Sense HAT, Weather Underground station
MIT License
64 stars 25 forks source link

pi_weather_station #6

Open ronadt opened 4 years ago

ronadt commented 4 years ago

Rasp pi 4, python 2.x or 3.x stops with this error: ImportError: cannot import name 'urlencode' from 'urllib' (/usr/lib/python3.7/urllib/init.py) Can't find much info on this, I am very new to this...

johnwargo commented 4 years ago

I assume that you're running Python 2 for this project, because that's the default for Raspbian. You're running Python 3 and I did a quick google search on the error message (which you should do any time you encounter an error) and came up with this: https://stackoverflow.com/questions/44031471/importerror-cannot-import-name-urlencode-when-trying-to-install-flask-ext-sto

So you'll either run the server process using Python 2, or modify line 19 pf weather_station.py as described in the linked article.