Search the Community
Showing results for tags 'python3'.
Hi! I've put together a workflow to interact with Obsidian. It relies heavily on some Python libraries like NLTK and Gensim, and I've done my best to package them, following advice from @deanishe found elsewhere on this forum. However, I get an error when I try to run it on a different computer: ``` import regex._regex as _regex "ModuleNotFoundError:" No module named ‘regex._regex’ ``` For what I've gathered, that may have something to do with the fact that Regex (required by NLTK) comes with a precompiled binary that may not play well with the other system or its python interpreter. All my scripts have a shebang pointing to `/usr/bin/python3` and I'm comfortable with it as a minimum requirement, but is there any hope of properly packaging Regex with the workflow?
Hey, this has been addressed a few times but being something of a simpleton that's making it up as he goes along I haven't been able to find an answer that I understand. I'm trying to create a workflow that will run a python command that deletes all messages from bots in a Slack channel. To do this I've installed 'slack-cleaner' through Python, and it works fine within Terminal. The problem is that when I try to run that in a script in an Alfred workflow, it says "line 1: slack-cleaner: command not found". I looked through a few posts on here and found a response from @deanishe that suggested I need to install the slack-cleaner library into my workflow. So, I right-clicked the workflow, opened in terminal and used the command he suggested in this other thread which was pip3 install --target . slack-cleaner. That seemed to work as I was then able to see the library in my workflow, but it still says it can't find the slack-cleaner command when I run it. I am very mildly knowledgeable, verging on idiocy so it's very likely I have no idea what I'm doing and haven't understood the suggestions correctly, but any advice would be greatly appreciated. Thanks! If it helps, the code I'm trying to run is below, with essential info redacted. slack-cleaner --token <TOKEN> --message --group <GROUPNAME> --bot --perform --as_user
Alfred-Workflow installs with pip for python3, but on usage it calls modules that don't exist in python3. Is there a way around this, or do scripts need to be run with python 2? Will this change in the future? Very new to this, trying to setup my own simple workflow.
Hello. I try to write my first script filter plugin, but I've encountered a unexpected trouble with Unicode (non-ASCII) characters. This is a simplest example I could invent: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBar</title> <subtitle>foo bar is a test item</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) (I call it from script filter as /usr/local/bin/python3 outputtest.py.) It works fine until I want to add some non-ASCII characters: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBær</title> <subtitle>foo bær is a «test item»</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) Then it fails: [ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last): File "outputtest.py", line 12, in <module> print(xmloutput) UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 88: ordinal not in range(128) Why it happens? I can't believe that Alfred do not use Unicode in input/output. I think the root of problem in something else, but I can't find out where is it.