OpenVoiceOS / ovos_skill_manager

skill installer for OVOS
Apache License 2.0
5 stars 6 forks source link

Failing to install skills #6

Open adocampo opened 3 years ago

adocampo commented 3 years ago

When I try to install a skill with osm-install it fails with the following result:

$ osm-install --skill "Speed Test"
Speed Test does not look like a valid skill url, do you want to enable search? [y/N]: y

Search Results:
    appstore - branch - url 
1 - OpenVoiceOS - v0.1.0 https://github.com/NeonGeckoCom/speed-test.neon
2 - MycroftMarketplace - 47c4cc05237562f81b5c25c2883aa66f91f64280 https://github.com/luke5sky/speedtest-skill
0 - cancel installation

Select an option: 1
Do you want to install v0.1.0 https://github.com/NeonGeckoCom/speed-test.neon ? [y/N]: y
Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/bin/osm-install", line 8, in <module>
    sys.exit(install())
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/scripts/install.py", line 114, in install
    skill.install(folder)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 238, in install
    skills = self.requirements.get("skill", [])
AttributeError: 'list' object has no attribute 'get'

My /opt/mycroft/skills directory belongs to my user (the same user running mycroft services), besides that user has sudo powers and even with the NOPASSWD flag on visudo, so I guess there is no permissions issue I'm running the osm-install inside the virtualenv, activated via source ~/mycroft-core/venv-activate.sh

adocampo commented 3 years ago

Just tried with pip install git+URL, there was errors as well

(.venv) [malevolent@malevolo mycroft-core]$ pip install git+https://github.com/NeonGeckoCom/speed-test.neon
Collecting git+https://github.com/NeonGeckoCom/speed-test.neon
  Cloning https://github.com/NeonGeckoCom/speed-test.neon to /tmp/pip-req-build-663qiczm
  Running command git clone -q https://github.com/NeonGeckoCom/speed-test.neon /tmp/pip-req-build-663qiczm
    ERROR: Command errored out with exit status 1:
     command: /home/malevolent/mycroft-core/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-663qiczm/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-663qiczm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-663qiczm/pip-egg-info
         cwd: /tmp/pip-req-build-663qiczm/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.9/tokenize.py", line 392, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-663qiczm/setup.py'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.3.3 is available.
You should consider upgrading via the '/home/malevolent/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
adocampo commented 3 years ago

osm-install --skill GITHUB_URL works

adocampo commented 3 years ago

I noticed, when I try to install through osm-install without the --skill URL parameter, it still fails, but search shows the appstore name:

(.venv) [malevolent@malevolo skills]$ osm-install 
skill to install (url or search term): wolfram
wolfram does not look like a valid skill url, do you want to enable search? [y/N]: y

Search Results:
    appstore - branch - url 
1 - MycroftMarketplace - eface55448c473a4138024cf9859f631ecd9c426 https://github.com/MycroftAI/fallback-wolfram-alpha
2 - MycroftMarketplace - 60bd41663a09036f4cadf2325a6a1037d0fafd1d https://github.com/MycroftAI/skill-pairing
3 - pling.opendesktop - master https://github.com/JarbasSkills/skill-wolfie
0 - cancel installation

Select an option: 3
Do you want to install master https://github.com/JarbasSkills/skill-wolfie ? [y/N]: y
Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/bin/osm-install", line 8, in <module>
    sys.exit(install())
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/scripts/install.py", line 114, in install
    skill.install(folder)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 238, in install
    skills = self.requirements.get("skill", [])
AttributeError: 'list' object has no attribute 'get'
(.venv) [malevolent@malevolo skills]$ osm-install --skill https://github.com/JarbasSkills/skill-wolfie

but when I use the --skill URL parameter, yet it installs the skill, the appstore name is shown as "unknown":

(.venv) [malevolent@malevolo skills]$ osm-install --skill https://github.com/JarbasSkills/skill-wolfie

Search Results:
    appstore - branch - url 
1 - unknown - master https://github.com/JarbasSkills/skill-wolfie
0 - cancel installation

Select an option: 1
Do you want to install master https://github.com/JarbasSkills/skill-wolfie ? [y/N]: y
(.venv) [malevolent@malevolo skills]$
JarbasAl commented 3 years ago

@adocampo i believe these are all fixed, could you please test version 0.0.5 ?

ChanceNCounter commented 3 years ago

bump

adocampo commented 3 years ago

sorry dudes... just installed 0.5.1 and it doesn't even start

[malevolent@malevolo mycroft-core]$ osm
Traceback (most recent call last):
  File "/home/malevolent/.local/bin/osm", line 5, in <module>
    from ovos_skills_manager.commands import osm_commands
  File "/home/malevolent/.local/lib/python3.9/site-packages/ovos_skills_manager/commands.py", line 2, in <module>
    from click_default_group import DefaultGroup
ModuleNotFoundError: No module named 'click_default_group'
adocampo commented 3 years ago

sorry, I slept today barely 3h1/2... I noticed I installed osm outside a venv... but it seems to fail as well

nstalling collected packages: kthread, ovos-utils, ovos-skills-manager
  Attempting uninstall: ovos-utils
    Found existing installation: ovos-utils 0.0.5
    Uninstalling ovos-utils-0.0.5:
      Successfully uninstalled ovos-utils-0.0.5
  Attempting uninstall: ovos-skills-manager
    Found existing installation: ovos-skills-manager 0.0.1
    Uninstalling ovos-skills-manager-0.0.1:
      Successfully uninstalled ovos-skills-manager-0.0.1
Successfully installed kthread-0.2.2 ovos-skills-manager-0.0.6 ovos-utils-0.0.11
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/malevolent/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
(.venv) [malevolent@malevolo mycroft-core]$ osm --install wolfram
Traceback (most recent call last):
  File "/home/malevolent/.local/bin/osm", line 5, in <module>
    from ovos_skills_manager.commands import osm_commands
  File "/home/malevolent/.local/lib/python3.9/site-packages/ovos_skills_manager/commands.py", line 2, in <module>
    from click_default_group import DefaultGroup
ModuleNotFoundError: No module named 'click_default_group'
ChanceNCounter commented 3 years ago

That was fixed earlier today. Sorry, I should have realized it was in current pip.

edit: yesterday now o.o

adocampo commented 3 years ago

So... do I need to ckeck it again?

ChanceNCounter commented 3 years ago

Ultimately, but not this second. Sorry 🤐 there's one open PR that should be merged today, and then a new version will be released which should be working. You can try that branch, if you want, but hassle

adocampo commented 3 years ago

I'd rather wait for the new version then ;)

ChanceNCounter commented 3 years ago

Just released last night/this AM, informing people in phases because HEAT WAVE 🌞🌎🌡️💥🥵

adocampo commented 3 years ago

We had here the first heat wave of the year two weeks ago (still on spring)... if you don't have them yet, ceiling fans are awesome, I'm under one of them 24h a day, I just need to turn AC only in the hottest and most humid days.

On the other hand, I still see version 0.0.6 on pip... am I doing sth wrong or we need to pip to refresh?

ChanceNCounter commented 3 years ago

Definitely on 0.0.8: https://pypi.org/project/ovos-skills-manager/

adocampo commented 3 years ago

Well, now I can run the osm command without errors, but I'm still unable to install anything

(.venv) [malevolent@malevolo mycroft-core]$ osm search wikipedia
2021-07-01 14:30:50.312 - OVOS - ovos_skills_manager.appstores:bootstrap:51 - INFO - Bootstrapping InstalledSkills, this might take a while!
Wikipedia https://github.com/MycroftAI/skill-wiki
Wikipedia https://github.com/JarbasSkills/skill-wikipedia-for-humans
Wikipedia https://github.com/MycroftAI/skill-wiki
Wikipedia https://github.com/einstalek/ru-wiki
Wikipedia https://github.com/AIIX/plasma-skill-wiki
Wikipedia https://github.com/Shivaabhai/webmd-skill
(.venv) [malevolent@malevolo mycroft-core]$ osm install https://github.com/JarbasSkills/skill-wikipedia-for-humans
2021-07-01 14:31:04.519 - OVOS - ovos_skills_manager.github:get_requirements_json:209 - ERROR - Error reading from manifest!
2021-07-01 14:31:05.980 - OVOS - ovos_skills_manager.github:get_requirements_json:222 - ERROR - Error reading skills requirements!

Search Results:
    appstore - branch - url 
1 - unknown - v0.2.2 https://github.com/JarbasSkills/skill-wikipedia-for-humans
0 - cancel installation

Select an option: 1
Do you want to install v0.2.2 https://github.com/JarbasSkills/skill-wikipedia-for-humans ? [y/N]: y
2021-07-01 14:31:13.062 - OVOS - ovos_skills_manager.skill_entry:install:274 - INFO - Installing skill: https://github.com/JarbasSkills/skill-wikipedia-for-humans from branch: v0.2.2
2021-07-01 14:31:13.063 - OVOS - ovos_skills_manager.skill_entry:install:291 - INFO - Running pip install
2021-07-01 14:31:13.064 - OVOS - ovos_skills_manager.requirements:pip_install:43 - INFO - (pip) Installing ovos_utils
2021-07-01 14:31:13.960 - OVOS - ovos_skills_manager.requirements:pip_install:43 - INFO - (pip) Installing wikipedia_for_humans>=0.2.3
2021-07-01 14:31:17.938 - OVOS - ovos_skills_manager.skill_entry:install:294 - INFO - Downloading https://github.com/JarbasSkills/skill-wikipedia-for-humans
Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/bin/osm", line 8, in <module>
    sys.exit(osm_commands())
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/commands.py", line 98, in install
    _install.install(method, skill, fuzzy, no_ignore_case, thresh, appstore, search,
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/scripts/install.py", line 92, in install
    skill.install(folder)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 295, in install
    updated = self.download(folder)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 254, in download
    return install_skill(url, folder, file, session=requests,
TypeError: install_skill() got an unexpected keyword argument 'session'
(.venv) [malevolent@malevolo mycroft-core]$ 
ChanceNCounter commented 3 years ago

Presumptive version mismatch, due to an unpinned dep in setup.py, pinned in requirements.txt. Should be fixed by #49 in short order. Nice catch.

adocampo commented 3 years ago

nice, please let me know when I should try again

ChanceNCounter commented 3 years ago

Apologies for the delay. v0.0.9a1 should now be available.

adocampo commented 3 years ago

Ok, so, now it seems to work... I've tried to install like 10 skills and just 1 got installed (skill-wikipedia-for-humans) Most of the others gave me an exception, but I guess this is not osm's fault, an example.

(.venv) malevolent@malevolo ~/mycroft-core (dev)$ osm install https://github.com/AIIX/youtube-skill
Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/__init__.py", line 21, in get_skill_data
    branch = get_branch_from_github_url(url)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/utils.py", line 113, in get_branch_from_github_url
    raise GithubInvalidBranch
ovos_skills_manager.exceptions.GithubInvalidBranch

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/__init__.py", line 147, in get_branch_from_skill_json
    return get_branch_from_skill_json_github_api(url, branch)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/api.py", line 420, in get_branch_from_skill_json_github_api
    json_data = get_skill_json_from_github_api(url, branch)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/api.py", line 333, in get_skill_json_from_github_api
    data = get_file_from_github_api(url, dst.format(repo=repo), branch)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/api.py", line 151, in get_file_from_github_api
    branch = branch or get_main_branch_from_github_api(url)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/api.py", line 126, in get_main_branch_from_github_api
    data = get_repo_data_from_github_api(url, branch)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/api.py", line 62, in get_repo_data_from_github_api
    raise GithubAPIRateLimited
ovos_skills_manager.exceptions.GithubAPIRateLimited

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/raw.py", line 269, in get_skill_json_from_github_url
    return json.loads(res)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/raw.py", line 489, in get_branch_from_skill_json_github_url
    json_data = get_skill_json_from_github_url(url, branch)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/raw.py", line 274, in get_skill_json_from_github_url
    raise GithubFileNotFound
ovos_skills_manager.exceptions.GithubFileNotFound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/malevolent/mycroft-core/.venv/bin/osm", line 8, in <module>
    sys.exit(osm_commands())
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/commands.py", line 98, in install
    _install.install(method, skill, fuzzy, no_ignore_case, thresh, appstore, search,
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/scripts/install.py", line 62, in install
    skills = [SkillEntry.from_github_url(skill, branch)]
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 87, in from_github_url
    return SkillEntry.from_json({"url": url, "branch": branch},
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 80, in from_json
    raise e
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/skill_entry.py", line 75, in from_json
    github_data = get_skill_data(url, data.get("branch"))
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/__init__.py", line 24, in get_skill_data
    branch = get_branch_from_skill_json(url)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/__init__.py", line 149, in get_branch_from_skill_json
    return get_branch_from_skill_json_github_url(url)
  File "/home/malevolent/mycroft-core/.venv/lib/python3.9/site-packages/ovos_skills_manager/github/raw.py", line 494, in get_branch_from_skill_json_github_url
    raise GithubFileNotFound
ovos_skills_manager.exceptions.GithubFileNotFound
ChanceNCounter commented 3 years ago

That's interesting. Are you sure you're running 0.0.9?

adocampo commented 3 years ago

0.0.9a1 in fact (a --version would be nice to have 😝 )

EDITED: just saw pip install output

Installing collected packages: ovos-skill-installer, ovos-skills-manager
  Attempting uninstall: ovos-skill-installer
    Found existing installation: ovos-skill-installer 0.0.2
    Uninstalling ovos-skill-installer-0.0.2:
      Successfully uninstalled ovos-skill-installer-0.0.2
  Attempting uninstall: ovos-skills-manager
    Found existing installation: ovos-skills-manager 0.0.8
    Uninstalling ovos-skills-manager-0.0.8:
      Successfully uninstalled ovos-skills-manager-0.0.8
Successfully installed ovos-skill-installer-0.0.5 ovos-skills-manager-0.0.9a1

those version mismatch are normal?

NeonDaniel commented 2 years ago

Latest published version is 0.0.9a4 as of now. @adocampo was this issue ever resolved?

also, osm --version functionality is in the repo, just need a new PyPI release ;)