Custom Input (Xiaom...
 
Notifications
Clear all

Custom Input (Xiaomi LYWSD03MMC) Dependency Problem  

  RSS

burrito
(@burrito)
New Member
Joined: 5 months ago
Posts: 3
July 14, 2020 4:50 pm  

Hello! I'm very new to Mycodo, but have absolutely loved what I've seen, so first of all I'd like to thank Kyle and all the work of this kind community that has helped in making this amazing tool.

As someone with little coding experience and a very limited linux background, making Mycodo work has been challenging. I'm currently trying to build a custom input script for the Xiaomi LYWSD03MMC Bluetooth Hygrometer through an awesome library I found called miblepy by benleb.

My problem is that when I try to open the custom input script I load (successfully), I get a dependency problem. miblepy doesn't seem to be installing.

I was wondering if maybe someone with more experience could help me with this? Sorry if it's a dumb question and thanks in advance.

-----

This is my dependency declaration in the script:

'dependencies_module': [
('apt', 'libglib2.0-dev', 'libglib2.0-dev'),
('pip-pypi', 'bluepy', 'bluepy'),
('pip-pypi', 'btlewrap', 'btlewrap'),
('pip-git', 'miblepy', 'git://github.com/benleb/miblepy.git#egg=miblepy')

This is the dependency log output:

[2020-07-14 16:26:04] Dependency installation beginning. Installing: miblepy

[2020-07-14 16:26:04] 
[2020-07-14 16:26:04] #### Installing/updating git://github.com/benleb/miblepy.git#egg=miblepy (pip-git)
[2020-07-14 16:26:06] Looking in indexes:  https://pypi.org/simple,  https://www.piwheels.org/simple
[2020-07-14 16:26:06] Obtaining miblepy from git+git://github.com/benleb/miblepy.git#egg=miblepy
[2020-07-14 16:26:06]   Updating ./env/src/miblepy clone
[2020-07-14 16:26:06]   Running command git fetch -q --tags
[2020-07-14 16:26:06]   Running command git reset --hard -q 989964c470e8d72420c5fde0b3dd34bd00ccff31
[2020-07-14 16:26:06]   Installing build dependencies: started
[2020-07-14 16:26:07]   Installing build dependencies: finished with status 'error'
[2020-07-14 16:26:07]   ERROR: Command errored out with exit status 1:
[2020-07-14 16:26:07]    command: /home/pi/Mycodo/env/bin/python /home/pi/Mycodo/env/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-8_3vfn44/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i  https://pypi.org/simple  --extra-index-url  https://www.piwheels.org/simple  -- 'poetry>=0.12'
[2020-07-14 16:26:07]        cwd: None
[2020-07-14 16:26:07]   Complete output (44 lines):
[2020-07-14 16:26:07]   Traceback (most recent call last):
[2020-07-14 16:26:07]     File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
[2020-07-14 16:26:07]       "__main__", mod_spec)
[2020-07-14 16:26:07]     File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
[2020-07-14 16:26:07]       exec(code, run_globals)
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/__main__.py", line 26, in <module>
[2020-07-14 16:26:07]       sys.exit(_main())
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 73, in main
[2020-07-14 16:26:07]       command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
[2020-07-14 16:26:07]       module = importlib.import_module(module_path)
[2020-07-14 16:26:07]     File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
[2020-07-14 16:26:07]       return _bootstrap._gcd_import(name[level:], package, level)
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap_external>", line 728, in exec_module
[2020-07-14 16:26:07]     File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 24, in <module>
[2020-07-14 16:26:07]       from pip._internal.cli.req_command import RequirementCommand, with_cleanup
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 16, in <module>
[2020-07-14 16:26:07]       from pip._internal.index.package_finder import PackageFinder
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 21, in <module>
[2020-07-14 16:26:07]       from pip._internal.index.collector import parse_links
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 14, in <module>
[2020-07-14 16:26:07]       from pip._vendor import html5lib, requests
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py", line 114, in <module>
[2020-07-14 16:26:07]       from . import utils
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 25, in <module>
[2020-07-14 16:26:07]       from . import certs
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_vendor/requests/certs.py", line 15, in <module>
[2020-07-14 16:26:07]       from pip._vendor.certifi import where
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py", line 1, in <module>
[2020-07-14 16:26:07]       from .core import contents, where
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/pip/_vendor/certifi/core.py", line 12, in <module>
[2020-07-14 16:26:07]       from importlib.resources import read_text
[2020-07-14 16:26:07]     File "/usr/lib/python3.7/importlib/resources.py", line 11, in <module>
[2020-07-14 16:26:07]       from typing import Iterable, Iterator, Optional, Set, Union   # noqa: F401
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/typing.py", line 1359, in <module>
[2020-07-14 16:26:07]       class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
[2020-07-14 16:26:07]     File "/home/pi/Mycodo/env/lib/python3.7/site-packages/typing.py", line 1007, in __new__
[2020-07-14 16:26:07]       self._abc_registry = extra._abc_registry
[2020-07-14 16:26:07]   AttributeError: type object 'Callable' has no attribute '_abc_registry'
[2020-07-14 16:26:07]   ----------------------------------------
[2020-07-14 16:26:07] ERROR: Command errored out with exit status 1: /home/pi/Mycodo/env/bin/python /home/pi/Mycodo/env/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-8_3vfn44/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i  https://pypi.org/simple  --extra-index-url  https://www.piwheels.org/simple  -- 'poetry>=0.12' Check the logs for full command output.

[2020-07-14 16:26:08] End install of miblepy

[2020-07-14 16:26:08] 
[2020-07-14 16:26:08] #### Setting permissions

[2020-07-14 16:26:09] #### All Dependencies have been installed.

Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 6 years ago
Posts: 368
July 14, 2020 5:26 pm  

Why not try just pip-pypi with miblepy instead of pip-git?

Mycodo Developer


ReplyQuote
burrito
(@burrito)
New Member
Joined: 5 months ago
Posts: 3
July 14, 2020 5:37 pm  

@kylegabriel

Hey! Thanks for the quick reply and thanks for this valuable tool.

pip was giving me a different issue, despite miblepy seemingly being available. I feel like I'm doing something very stupid.

 

dependencies in script:

'dependencies_module': [
('apt', 'libglib2.0-dev', 'libglib2.0-dev'),
('pip-pypi', 'bluepy', 'bluepy'),
('pip-pypi', 'btlewrap', 'btlewrap'),
('pip-pypi', 'miblepy', 'miblepy')
],

 

dependencies log:

[2020-07-14 17:28:46] Dependency installation beginning. Installing: miblepy

[2020-07-14 17:28:46]
[2020-07-14 17:28:46] #### Installing/updating miblepy (pip-pypi)
[2020-07-14 17:28:48] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2020-07-14 17:28:50] ERROR: Could not find a version that satisfies the requirement miblepy (from versions: none)
[2020-07-14 17:28:50] ERROR: No matching distribution found for miblepy

[2020-07-14 17:28:50] End install of miblepy

[2020-07-14 17:28:50]
[2020-07-14 17:28:50] #### Setting permissions

[2020-07-14 17:28:51] #### All Dependencies have been installed.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 6 years ago
Posts: 368
July 14, 2020 5:57 pm  

I'm unable to install it either via pypi or pip install from a clone. It doesn't seem to support the software environment of Buster.

Mycodo Developer


ReplyQuote
burrito
(@burrito)
New Member
Joined: 5 months ago
Posts: 3
July 14, 2020 6:05 pm  

Welp, guess I'll look for something else. Thanks for your help and I'll keep you posted if I get the custom input working. :)


ReplyQuote