Page 1 of 1

MatPlotlib errors

PostPosted: Mon Jul 18, 2022 7:59 am
by Londonmark
Hi,

Setting everything up on a new machine in a new house so gradually replicating what I had on my old set-up. That included weather charts from Matplotlib and Fantastic Weather. However, I am getting this error:

Matplotlib Error [Hourly forecast chart] Error type: invalid literal for int() with base 10: ''
Matplotlib Error [Hourly forecast chart] error producing chart. See logs for more information.

Any simple fix?

LM

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 9:00 am
by DaveL17
There's not enough here to diagnose the problem, but I can say that I'm not getting similar errors on either server.

1. Do you have a fully-configured Fantastic Weather Plugin *and* and fully-configured Hourly Forecast Device set up?
2. Is the Fantastic Weather Hourly Forecast Device populated with valid data in its states?

The error is saying that the Matplotlib Plugin can't convert the target Hourly Forecast state (which is an empty string) to an integer.

chart_forecast_hourly.png
chart_forecast_hourly.png (15.25 KiB) Viewed 2143 times

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 9:09 am
by Londonmark
I think the answer to both questions is yes.

Here is more from the log...

Code: Select all
2022-07-18 00:12:14.744   DEBUG        Plugin.charts_refresh               Updating chart: [Hourly forecast chart]
2022-07-18 00:12:14.772   DEBUG        Plugin.charts_refresh               [Hourly forecast chart] Sending to chart refresh process.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] payload unpacked successfully.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Formatting dates.
2022-07-18 00:12:15.287   DEBUG        Plugin.process_plotting_log         [Hourly forecast chart] Traceback (most recent call last):
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/matplotlib.indigoPlugin/Contents/Server Plugin/chart_tools.py", line 519, in format_axis_y
    mtick.FormatStrFormatter(f"%.{int(p_dict.get('yAxisPrecision', '0'))}f")
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/matplotlib.indigoPlugin/Contents/Server Plugin/chart_weather_forecast.py", line 174, in <module>
    chart_tools.format_axis_y(ax=ax1, p_dict=P_DICT, k_dict=K_DICT, logger=LOG)
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/matplotlib.indigoPlugin/Contents/Server Plugin/chart_tools.py", line 545, in format_axis_y
    f"[{name}] %.{int(p_dict['yAxisPrecision'])}f"
ValueError: invalid literal for int() with base 10: ''

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 9:27 am
by DaveL17
Okay, we're zeroing in on it. Within the Matplotlib Chart Device, what is the setting for the 'Y Axis Precision'?

Also, what version of the plugin and what version of Indigo are you running?

Screen Shot 2022-07-18 at 10.25.17 AM-2.png
Screen Shot 2022-07-18 at 10.25.17 AM-2.png (194.97 KiB) Viewed 2134 times

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 1:33 pm
by Londonmark
Solved it with the Y1 formatting menu. Thanks for your help and sorry for having been a total muppet... Had missed that menu.

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 4:39 pm
by DaveL17
It's not your fault. The plugin is a victim of its customizability. There are so many settings that I had to break them into groups to make them somewhat manageable. :D

Glad you were able to sort it out.

Re: MatPlotlib errors

PostPosted: Mon Jul 18, 2022 4:40 pm
by DaveL17
And if you're actually in London -- try to stay cool!

Re: MatPlotlib errors

PostPosted: Fri Nov 18, 2022 9:15 pm
by diefledermaus
I am running Indigo 2022.1.2 on OS 10.13.6 and I am unable to get matplotlib to function now I get a python error

Reloading plugin "Matplotlib 2022.1.4" using API v3.0
Starting plugin "Matplotlib 2022.1.4" (pid 13900)
Matplotlib Error Error in plugin execution InitializeMain:

File "plugin.py", line 41, in <module>
type: No module named 'numpy'

Stopping plugin "Matplotlib 2022.1.4" (pid 13900)
Stopped plugin "Matplotlib 2022.1.4"

Re: MatPlotlib errors

PostPosted: Sat Nov 19, 2022 5:35 am
by DaveL17
Sorry to hear that you're having trouble. Indigo 2022.1 ships with numpy v1.22.3 (v1.16.6 for Python 2.7), which is installed with lots of other Python 3 packages, and should be available on your system. I'm running Catalina 10.15.7 on my server and the Matplotlib plugin runs fine. Indigo supports Sierra 10.12, so that should not be an issue. The Matplotlib plugin doesn't ship with any additional Python packages and it should work on your system. My first recommendation would be to re-run the Indigo installer to make sure that all the needed Python packages are installed in their proper locations. Do you have any other instances of Python installed on this machine (other than the ones that ship with Indigo?)