oref0: Fresh install fails with "AttributeError: 'module' object has no attribute 'Locale'" while importing device.json

Describe the bug Fresh install fails oref0-setup with AttributeError: 'module' object has no attribute 'Locale' while importing device.json.

To Reproduce Steps to reproduce the behavior:

  1. Jubilinux 0.3.0
  2. Install according to docs

Expected behavior A succesfull install

Errors The install fails with

2020-06-02 02:38:48,581 INFO All permissions in Nightscout are ok
Importing /root/src/oref0/lib/oref0-setup/vendor.json
openapscontrib.timezones://
mmeowlink.vendors.mmeowlink://
Importing /root/src/oref0/lib/oref0-setup/device.json
Traceback (most recent call last):
  File "/usr/local/bin/openaps-import", line 89, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/bin/openaps-import", line 81, in run
    incoming = self.Make(candidate)
  File "/usr/local/bin/openaps-import", line 65, in Make
    inst = Configurable.FromImport(configurable, self.config)
  File "/usr/local/lib/python2.7/dist-packages/openaps/devices/device.py", line 66, in FromImport
    vendor = vendors.lookup_dotted(fields['vendor'], config)
  File "/usr/local/lib/python2.7/dist-packages/openaps/vendors/__init__.py", line 30, in lookup_dotted
    vendors = all_vendors(config)
  File "/usr/local/lib/python2.7/dist-packages/openaps/vendors/__init__.py", line 36, in all_vendors
    return get_vendors( ) + find_plugins(config)
  File "/usr/local/lib/python2.7/dist-packages/openaps/vendors/__init__.py", line 16, in find_plugins
    return [ v.get_module( ) for v in vendors ]
  File "/usr/local/lib/python2.7/dist-packages/openaps/vendors/plugins/vendor.py", line 19, in get_module
    return importlib.import_module(self.name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/openapscontrib/timezones/__init__.py", line 132, in <module>
    import recurrent
  File "/usr/local/lib/python2.7/dist-packages/recurrent/__init__.py", line 1, in <module>
    from recurrent.event_parser import RecurringEvent
  File "/usr/local/lib/python2.7/dist-packages/recurrent/event_parser.py", line 10, in <module>
    pdt = parsedatetime.Calendar()
  File "/usr/local/lib/python2.7/dist-packages/parsedatetime/__init__.py", line 270, in __init__
    self.ptc = Constants()
  File "/usr/local/lib/python2.7/dist-packages/parsedatetime/__init__.py", line 2381, in __init__
    self.locale = get_icu(self.localeID)
  File "/usr/local/lib/python2.7/dist-packages/parsedatetime/pdt_locales/icu.py", line 56, in get_icu
    result['icu'] = icu = pyicu.Locale(locale)
AttributeError: 'module' object has no attribute 'Locale'
Could not import /root/src/oref0/lib/oref0-setup/device.json

Setup Information (please complete the following information): Pump WW, CGM Dexcom G6 / oref 0.7.0-dev / rig Explorer board

Additional context Fresh install. Temporary workaround. disable: do_openaps_import statements from oref0-setup.sh

   # import template
   #do_openaps_import $HOME/src/oref0/lib/oref0-setup/vendor.json
   #do_openaps_import $HOME/src/oref0/lib/oref0-setup/device.json
   #do_openaps_import $HOME/src/oref0/lib/oref0-setup/report.json
   #do_openaps_import $HOME/src/oref0/lib/oref0-setup/alias.json

Please tell me what the suggested route is to fix, and I’ll create a PR.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

@PieterGit Solution found for now - replace version of python package from 2.6 to 2.5 pip install parsedatetime==2.5

After running this, run again the installation, it finishes successfuly

Submitted a PR that fixes this in dev.

@yduncan Just run: pip install parsedatetime==2.5 It will replace the relevant package (not entire python, just one package in my case)

Before running the bootstrap script? Or change it in the bootstrap?

Or it may have been in the setup script. I’m not that technical sorry.

@yduncan I was able to get up and running by running pip install parsedatetime==2.5 right after the first setup failed as noted. I ran oref0-setup again after the pip command and setup completed successfully.

I’m not sure that this is a common problem, so I wouldn’t know whether this should result in updates to the oref0-setup script or not.

After switching to the dev branch of oref0, does this still happen? The fix has only been applied to the dev branch, and I installed 2 rigs this morning without encountering this issue.

I’m not saying there’s not an issue. I’m trying to narrow down where the issue is.

@yduncan Just run:

pip install parsedatetime==2.5

It will replace the relevant package (not entire python, just one package in my case)

Before running the bootstrap script? Or change it in the bootstrap?

Or it may have been in the setup script. I’m not that technical sorry.

@yduncan Just run: pip install parsedatetime==2.5

It will replace the relevant package (not entire python, just one package in my case)