sh: zowie: command not found when applying smart rule
When a new file is added, my smart rule which should create the comment with the Zotero link fails with this message:
sh: zowie: command not found
I'm using the script and the smart rule setting from this link: https://github.com/mhucka/zowie/wiki/Example:-using-Zowie-with-DEVONthink
When I run Zowie from command line with zowie -s ~/Zotero everything works fine. I checked also the installation of Zowie with pip show zowie:
Name: zowie Version: 1.2.0 Summary: Write Zotero select links into article attachment files Home-page: https://github.com/mhucka/zowie Author: Michael Hucka Author-email: [email protected] License: BSD 3-clause Location: /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages Requires: aenum, biplist, boltons, bun, commonpy, keyring, keyrings.alt, pdfrw, plac, py-applescript, pyobjc-core, pyobjc-framework-AppleScriptKit, pyobjc-framework-AppleScriptObjC, pyxattr, pyzotero, setuptools, sidetrack Required-by:
I tried adding /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages to the script:
set result to do shell script ¬ ¬ "PATH=$PATH:$HOME/.local/bin:/usr/local/bin:/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages" & " zowie -s -q " & quoted_file_path
But this doesn't help. Any suggestion what might be wrong?
Hey dystopos,
instead of adding the site-packages folder to the PATH-environment, you need to direct the shell to the folder where the executable binaries are stored. Thus, instead of adding /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages try /opt/homebrew/bin. In my case – I've also installed Zowie using pip – this helped.
Best regards Ruben
Hi,
I can run zowie from the terminal: python3 -m zowie -a (KEY) -s ~/Zotero
Python is here: /usr/bin/python3
The version is: Python 3.11.0
If I put zowie here: /usr/local/bin/zowie
Running the Script in Devonthink gives back: The self-contained executable of Zowie 1.3.0 that you are attempting to run was built to work specifically (and only) with version 3.11 of Python. The version of Python obtained by running "python3" on your computer is 3.9. This makes it incompatible and prevents this copy of Zowie from running.
If I delete zowie from /usr/local/bin/zowie I get: sh: zowie: command not found
But zowie is still running when I use python3 -m zowie -a (KEY) -s ~/Zotero
I try to adjust the path in the script. Zowie is here: /Library/Frameworks/Python.framework/Versions/3.11/bin/zowie
set result to do shell script ¬ "PATH=$PATH:$HOME/.local/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin" & " python3 -m zowie -s -q " & quoted_path
Which results in : /Library/Developer/CommandLineTools/usr/bin/python3: No module named zowie
Here I'm stuck. How do I have to adjust the path to allow the script to find zowie?
Thanks for a hint. Christof
Hi – can you let me know the method you used to install Zowie?
Also, when you say "if I put zowie here", what is it the origin of the file zowie that you are copying? (I mean, where did it come from?)
Hi, Thanks for asking.
I used "Alternative 3: installing Zowie using pip" I tried to adjust the path as described above. No success.
After having tried several things, I just entered:
sudo mv zowie /usr/local/bin
In DEVONthink I used your original script, I made no changes.
Now it works like charm.
It takes some time, as I have > 15'000 PDFs. But it works. Thanks for this very useful piece of software that allows me to do research in DEVONthink and then to smoothly switch to Zotero. A positive side effect is that all the orphaned PDFs are detected.
Best wishes, Christof