为什么我无法通过 automator 工作流程执行 pubmex.py python 脚本?

发布于 2025-01-12 14:59:58 字数 1448 浏览 4 评论 0原文

我试图通过 macOS Automator 执行 python 脚本,方法是选择第一个文件,然后从我的查找器中调用 Automator 工作流程,如下图所示。 输入图片这里的描述

我尝试执行的 python 文件是一个脚本,该脚本应该将期刊文章的文件名更改为标准化格式。 GitHub 存储库

为什么我在尝试在 pdf 上使用 python 脚本时收到以下错误通过 Automator 工作流程文件?

似乎在使用 pubmex 附带的 Automator 安装时找不到 pubmex.py。

    for f in "$@"
    do
        pubmex.py $f
    done

显示以下错误:

操作“运行 Shell 脚本”遇到错误:“zsh:3: 未找到命令:pubmex.py”

当指定另一个 pubmex.py 文件的直接位置时发生错误。

    for f in "$@"
    do
        /users/suntim/miniforge3/bin/pubmex.py $f
    done

显示以下错误:

“运行 Shell 脚本”操作遇到错误:“”

当指定 python 和 pubmex.py 文件的直接位置时,会发生另一个错误。

    for f in "$@"
    do
        /usr/local/bin/python3 /users/suntim/miniforge3/bin/pubmex.py $f
    done

显示以下错误:

操作“运行 Shell 脚本”遇到错误:“回溯(最近一次调用最后):文件“/users/suntim/miniforge3/bin/pubmex.py”,第 27 行,在 < 中;模块> from Bio import Entrez ModuleNotFoundError:没有名为“Bio”的模块”

我已安装所有依赖项 pip3 install pubmexpip3 install biopythonbrew install poppler。正如 readme.md 中所说,biopython 应该通过 brew 安装,我认为这是一个错误。我是通过 pip3 安装的。

无论使用 zsh 还是 bash 版本,都会出现相同的错误消息。

I'm trying to execute a python script via the macOS Automator by selecting first files and then calling the Automator workflow from my finder as can be seen in the image below. enter image description here

the python file I'm trying to execute is a script that is supposed to change the file name of journal articles to a standardized format. GitHub repository

Why is it that I'm receiving the following errors when trying to use the python script on pdf files via an Automator workflow?

It seems that when using the Automator installations that come with the pubmex the pubmex.py can not be found.

    for f in "$@"
    do
        pubmex.py $f
    done

The following error is displayed:

The action “Run Shell Script” encountered an error: “zsh:3: command not found: pubmex.py”

When specifying the direct location of just the pubmex.py file another error occures.

    for f in "$@"
    do
        /users/suntim/miniforge3/bin/pubmex.py $f
    done

The following error is displayed:

The action “Run Shell Script” encountered an error: “”

When specifying the direct location of python and the pubmex.py file another error occures.

    for f in "$@"
    do
        /usr/local/bin/python3 /users/suntim/miniforge3/bin/pubmex.py $f
    done

The following error is displayed:

The action “Run Shell Script” encountered an error: “Traceback (most recent call last): File "/users/suntim/miniforge3/bin/pubmex.py", line 27, in <module> from Bio import Entrez ModuleNotFoundError: No module named 'Bio'”

I have all dependencies installed pip3 install pubmex, pip3 install biopython, brew install poppler. As it says in the readme.md that biopython should be isntalled via brew I assume that was a mistake. I instead installed it via pip3.

The same error messages occure regardless of using the zsh or bash version.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文