MycroftAI/mycroft-core

Picroft mycroft-msk fails with import error on git library

mikejgray opened this issue · 7 comments

Describe the bug
When I try to run mycroft-msk on a Picroft, I get an import error:

Traceback (most recent call last):
  File "/home/pi/mycroft-core/.venv/bin/msk", line 5, in <module>
    from msk.__main__ import main
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/msk/__main__.py", line 23, in <module>
    from msk.actions.create import CreateAction
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/msk/actions/create.py", line 34, in <module>
    from msk.console_action import ConsoleAction
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/msk/console_action.py", line 21, in <module>
    from msk.global_context import GlobalContext
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/msk/global_context.py", line 23, in <module>
    from msk.util import ask_for_github_token
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/msk/util.py", line 25, in <module>
    from git.config import GitConfigParser, get_config_path
ImportError: cannot import name 'get_config_path' from 'git.config' (/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/git/config.py)

To Reproduce
Steps to reproduce the behavior:

  1. Install Picroft on a Raspberry Pi 4 using the latest image from the documentation
  2. Execute mycroft-msk from the CLI

Expected behavior
I get the wizard to create a skill template.

Environment (please complete the following information):

  • Device type: Raspberry Pi 4
  • OS: Picroft
  • Mycroft-core version: 21.2.2

Additional context
This is a clean installation from the Picroft image available via the docs.

Ah, it looks like this is due to #48. The workaround fixed my problem.

Happy to try to close, just unsure where. Does the requirements.txt in this repo need the update, or is there someplace else where the Picroft images are built?

Hi, so this is a bit tricky. The msk setup.py requires the gitpython module to be atleast 3.0.5 but somehow it's not respected by pip.

We could try to bump it even further (it's at 3.1.27 now so it may be time for a bump anyways) but I'm not sure about the root cause of the issue.

If you think it's worth a try:

  • Update the setup.py (and bump the version number) in the mycroft-skills-kit repo
  • after it's been merged and released bump the requirement of mycroft-skills-kit in this repo's requirements/requirements.txt

As I said we never quite found out why it didn't update to the expected version on the picroft image so this may or may not be the right solution. :)

So I'm trying to develop a new skill and I'm hitting this error. I've more-or-less got my skill all set up by following the docs & another skill as an example but I want to test it on my mycroft (picroft) instance. What's the best way to get around this?

@derekantrican I think the simplest workaround is to run mycroft-pip install gitpython==3.0.5

Ah - perfect! I tried that with the exception of the mycroft- prefix but that caused some other issues. Did I do something wrong or does mycroft-pip do different stuff than pip?

mycroft-pip ensures that the package is installed in the correct virtual environment. Pip without the mycroft- could try to install it among the system packages which can can cause issues, would need sudo and the pavkage in the mycroft venv would be preferred over that one also.

Pip might work if the mycroft venv is activated but using mycroft-pip should always do the right thing