Jump to content

papunag209

Member
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

papunag209's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Thanks @vitor I found a workaround to add module path inside script itself, will read into resource you provided, thanks again Don't know if this is best practice probably not but if its any help for anyone here is my workaround global_module_path = "/opt/homebrew/lib/python3.11/site-packages" sys.path.append(global_module_path)
  2. Hi My first post on any forum hope it goes well, I am trying to make a workflow to help me use git for my job, I am trying to make a script filter which lists remote branches, I need to import git from GitPython. I have installed script inside workflow directory using pip3 ran this in my workflow root. pip install --target . gitpython file system looks like this in my workflow folder: . gitdb-4.0.10.dist-info .. info.plist GitPython-3.1.36.dist-info smmap git smmap-5.0.0.dist-info gitdb my script filter looks like this import sys import json from git import git r = Repo('~/Workspaces/apollo') remote_refs = r.remote().refs for refs in remote_refs: print(refs.name) subtitle = ' '.join(refs) query = sys.argv[1] out = {"items": [ { "uid": "desktop", "type": "file", "title": query, "subtitle": "sub" + subtitle, "arg": "123", "autocomplete": "Desktop", "icon": { "type": "fileicon", "path": "~/Desktop" } } ]} sys.stdout.write(json.dumps(out)) when I debug my flow I get this error: line 3, in <module> from git import git ModuleNotFoundError: No module named 'git' also one question I have because I am not very proficient with python, if anyone can inform me why does alfred's script filter not import modules installed globally, like any other script on my machine. Thanks in advance
×
×
  • Create New...