Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PG3 ELK node server 3.5.5 fails with error: cannot import name 'FunctionKeys'

Featured Replies

Posted

I have been using PG3 ELK node server successfully for about 6 months.  Today I noticed my Polisy v.5.4.4 was not detecting correct ELK status.  When I checked the node server it's status is 'Disconnected'.  Tried stop/start of node server, and finally reboot of Polisy, but always the same results.  I'm running PG3 version 3.0.62.  The node server attempts startup, but fails immediately with the follow error:

2022-11-07 11:34:11,744 MainThread udi_interface      INFO     polylogger:set_basic_config: set_basic_config: enable=True level=30
2022-11-07 11:34:14,308 MainThread udi_interface      INFO     __init__:<module>: UDI Python Interface for Polyglot version 3 3.0.46 Starting...
2022-11-07 11:34:14,524 MainThread udi_interface      ERROR    udi_interface:write: Traceback (most recent call last):
2022-11-07 11:34:14,525 MainThread udi_interface      ERROR    udi_interface:write: File "./elk-poly.py", line 10, in <module>
2022-11-07 11:34:14,526 MainThread udi_interface      ERROR    udi_interface:write: from nodes import Controller
2022-11-07 11:34:14,527 MainThread udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2/nodes/__init__.py", line 9, in <module>
2022-11-07 11:34:14,529 MainThread udi_interface      ERROR    udi_interface:write: from .Keypad import KeypadNode
2022-11-07 11:34:14,530 MainThread udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2/nodes/Keypad.py", line 7, in <module>
2022-11-07 11:34:14,531 MainThread udi_interface      ERROR    udi_interface:write: from elkm1_lib.const import (
2022-11-07 11:34:14,532 MainThread udi_interface      ERROR    udi_interface:write: ImportError
2022-11-07 11:34:14,533 MainThread udi_interface      ERROR    udi_interface:write: :
2022-11-07 11:34:14,533 MainThread udi_interface      ERROR    udi_interface:write: cannot import name 'FunctionKeys' from 'elkm1_lib.const' (/var/polyglot/.local/lib/python3.8/site-packages/elkm1_lib/const.py)

 

Any ideas?

Solved by Jimbo.Automates

Go to solution

That's odd, something must not have installed correctly, can you log into your polisy and run this?  Replace the _4 with the slot number of the ELK node server:

cd /var/polyglot/pg3/ns/*_4
sudo -u polyglot ./install.sh

 

  • Author

Gave that a shot and got an error. I verified I'm in the correct slot/directory by viewing the README.md file. And I verified that install.sh exists in this directory, (ls -l).  And the contents of ./install.sh is

[admin@polisy /var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2]$ cat ./install.sh
#!/usr/bin/env bash
pip3 install -r requirements.txt --user
 

 

 Not sure if this error is saying the install.sh is not found?  Or a line within the shell script?  And I'm assuming the 'Password:' it is asking for is the password for admin@ polisy. Again, I appreciate your help. Here's the error:

[admin@polisy /var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2]$ sudo -u polyglot ./install.sh
Password:
sudo: ./install.sh: command not found
[admin@polisy /var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2]$

  • Author

So now I get:

[admin@polisy /var/polyglot/pg3/ns/00:0d:b9:5e:e2:8c_2]$ sudo -u polyglot bash .                                 /install.sh
Password:
Collecting udi_interface>=3.0.47
  Using cached udi_interface-3.0.49-py3-none-any.whl (24 kB)
ERROR: Ignored the following versions that require a different python version: 1                                 .3.0 Requires-Python >=3.9,<4.0; 1.3.1 Requires-Python >=3.9,<4.0; 1.3.2 Require                                 s-Python >=3.9,<4.0; 1.3.3 Requires-Python >=3.9,<4.0; 1.3.4 Requires-Python >=3                                 .9,<4.0; 1.3.5 Requires-Python >=3.9,<4.0; 1.3.6 Requires-Python >=3.9,<4.0; 1.3                                 .dev0 Requires-Python >=3.9,<4.0; 2.0.0 Requires-Python >=3.9,<4.0; 2.0.1 Requir                                 es-Python >=3.9,<4.0; 2.0.2 Requires-Python >=3.9,<4.0; 2.1.0 Requires-Python >=                                 3.9,<4.0
ERROR: Could not find a version that satisfies the requirement elkm1_lib>=2.1.0<                                 2.2.0 (from versions: 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.                                 7.6, 0.7.7, 0.7.8, 0.7.9, 0.7.10, 0.7.11, 0.7.12, 0.7.13, 0.7.14, 0.7.15, 0.7.16                                 , 0.7.17, 0.7.18, 0.7.19, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7                                 , 0.8.8, 0.8.9, 0.8.10, 0.8.11, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.2.2)
ERROR: No matching distribution found for elkm1_lib>=2.1.0<2.2.0

  • Solution

Oh, that explains it.  You need to do an "Upgrade Modules" to get the latest python:

[admin@polisy-dev ~]$ python3 -V
Python 3.9.14

 

  • Author

Thanks!!  That did the trick.  I did an "Upgrade Packages" from the admin console yesterday, and restarted PG3 afterwards, or so I thought.  But issuing another "Upgrade Packages" just now, followed by a Polyglot restart seems to have fixed my problems.  Really appreciate you help, and the ELK nose server!

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.