Hello All,
I am new to coding in general and have been using a raspberry pi along with my macbook pro as a test bench for my python creations.
My most recent project was to run a python program every 5 minutes which uses a DH11 sensor to measure the temperature and humidity to a csv file.
I was then attempting to use Bokeh with Pandas to retrieve and plot the data every 10 minutes and generate a html file which could then be hosted on a web file.
This in practice worked perfectly on my laptop however when moving over to my raspberry pi the python program plotting the data returned this error:
Traceback (most recent call last):
File “DataAnalysis.py”, line 2, in
from bokeh.plotting import figure, output_file, show
File “/usr/local/lib/python2.7/dist-packages/bokeh/plotting/init.py”, line 2, in
from …document import Document; Document
File “/usr/local/lib/python2.7/dist-packages/bokeh/document.py”, line 28, in
from .core.json_encoder import serialize_json
File “/usr/local/lib/python2.7/dist-packages/bokeh/core/json_encoder.py”, line 49, in
from …util.serialization import convert_datetime_type, is_datetime_type, transform_series, transform_array
File “/usr/local/lib/python2.7/dist-packages/bokeh/util/serialization.py”, line 55, in
DATETIME_TYPES.add(pd.Timedelta)
AttributeError: ‘module’ object has no attribute ‘Timedelta’
Running Python 2.7, Bokeh 0.12.6
File DataAnlysis.py:
import pandas
from bokeh.plotting import figure, output_file
import time
import datetime
data = pandas.read_csv(“http://antondubek.hopto.org/dataFile.csv”, parse_dates = [“Time”])
p = figure(plot_width = 500, plot_height = 250, x_axis_type = ‘datetime’, responsive = True)
p.line(data[“Time”], data[“Humidity”], color = “Blue”, alpha = 0.5)
p.circle(data[“Time”], data[“Humidity”], size = 5, color = “Blue”)
p.line(data[“Time”], data[“Temperature”], color = “Red”, alpha = 0.5)
p.circle(data[“Time”], data[“Temperature”], size = 5, color = “Red”)
output_file(“/var/www/html/TempReadings.html”)
I have searched the web as best I can, uninstalled bokeh and reinstalled it both using pip still with no luck.
Any help would be appreciated.