Python Forum
error in python script (for energy meter)
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error in python script (for energy meter)
#5
(Nov-30-2017, 03:30 PM)buran Wrote: is the file name indeed config.py? it is expecting just config

ps: config is located in etc/smaemd/

After renaming it I get the following error:
sudo python sma-daemon.py
Error:
Traceback (most recent call last): File "sma-daemon.py", line 23, in <module> from configparser import SafeConfigParser ImportError: No module named configparser
sudo python3 sma-daemon.py
Error:
Traceback (most recent call last): File "/usr/local/lib/python3.5/configparser.py", line 1136, in _unify_values sectiondict = self._sections[section] KeyError: '[SMA-EM]' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "sma-daemon.py", line 30, in <module> smaemserials=parser.get('[SMA-EM]', 'serials') File "/usr/local/lib/python3.5/configparser.py", line 779, in get d = self._unify_values(section, vars) File "/usr/local/lib/python3.5/configparser.py", line 1139, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: '[SMA-EM]'

[inline]sudo systemctl daemon-reload
sudo systemctl enable smaemd.service
sudo systemctl start smaemd.service[/inline]

didn't change anything by the way
Reply


Messages In This Thread
RE: error in python script (for energy meter) - by br0ken - Nov-30-2017, 03:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Modify an Energy Model to account for year dependent interest rate rather than only t giovanniandrean 0 494 Oct-10-2023, 07:00 AM
Last Post: giovanniandrean
  Alicat Flow Meter data acquisition marenr 0 412 Sep-29-2023, 10:59 PM
Last Post: marenr
Sad "PriceSystem" Python Script error to Shopify API Alphetto 0 512 Jul-04-2023, 10:03 AM
Last Post: Alphetto
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,745 Jun-29-2023, 11:57 AM
Last Post: gologica
  No module named '_cffi_backend' error with executable not with python script stephanh 2 5,940 Nov-25-2021, 06:52 AM
Last Post: stephanh
  How to kill a bash script running as root from a python script? jc_lafleur 4 6,170 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,421 May-28-2020, 05:27 PM
Last Post: micseydel
  Python script Server list - if condition error razor04 12 5,507 Jan-27-2020, 09:05 PM
Last Post: razor04
  PYTHON Script ERROR Help Need alex9745 3 2,613 Sep-17-2019, 08:37 AM
Last Post: alex9745
  Using VBA to Call a Python script causes error in pyodbc connector pcarra 1 2,939 Jun-11-2019, 04:14 PM
Last Post: pcarra

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020