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.

TypeError: '<=' not supported between instances of 'str' and 'datetime.datetime'

See original GitHub issue

While 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
scmbradleycommented, Apr 7, 2021

I had this problem and rm -rf ~/.meteostat and pip install -U meteostat fixed this issue.

2reactions
clamprcommented, Apr 7, 2021

Can you try to re-install Meteostat with:

pip install meteostat==1.1.2 -U

By default, the .meteostat folder is located in your home directory (~).

Read more comments on GitHub >

github_iconTop 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 >

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