TypeError: '<=' not supported between instances of 'str' and 'datetime.datetime'
See original GitHub issueWhile running this Python example from the official documentation:
# Import Meteostat library and dependencies
from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Point, Daily
# Set time period
start = datetime(2018, 1, 1)
end = datetime(2018, 12, 31)
# Create Point for Vancouver, BC
vancouver = Point(49.2497, -123.1193, 70)
# Get daily data for 2018
data = Daily(vancouver, start, end)
data = data.fetch()
# Plot line chart including average, minimum and maximum temperature
data.plot(y=['tavg', 'tmin', 'tmax'])
plt.show()
I get the following error:
TypeError: '<=' not supported between instances of 'str' and 'datetime.datetime'
Note: I have all the dependencies installed as requested in the doc. I didn’t get this error a few days ago, I just got it today, maybe it’s related to the latest version?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: '>' not supported between instances of 'datetime ...
You have to use strptime to convert a string into a date. The comparaison operator only applies between datetime.
Read more >typeerror not supported between instances of datetime ...
The Python "TypeError: '>' not supported between instances of 'datetime.datetime' and 'str'" occurs when we try to compare a datetime object and a...
Read more >'' not supported between instances of 'datetime.date' and 'str'
Pandas : '' not supported between instances of ' datetime.date' and ' str ' [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >'>=' not supported between instances of 'str' and 'datetime.time ...
TypeError : '>=' not supported between instances of 'str' and 'datetime.time' in PyCharm? I'm trying to make my countdown timer start when ...
Read more >'>' not supported between instances of 'datetime ... - Quora
The way you fix it is to convert the string to a datetime value, ... not supported between instances of 'datetime.datetime' and 'str'”...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had this problem and
rm -rf ~/.meteostat
andpip install -U meteostat
fixed this issue.Can you try to re-install Meteostat with:
By default, the
.meteostat
folder is located in your home directory (~
).