Nodes/ComfyUI-ZML-Image/ZML_Python路径
ComfyUI Node

ZML_Python路径

Which Python is ComfyUI actually running, and is my package there?

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_Python路径
    • Python路径
    • pip路径
    • 包版本信息
    包名称torch
    全部包列表false

    ZML_Python路径 answers the single most annoying troubleshooting question in all of ComfyUI: which Python interpreter am I actually running, and does it have the package I need? It prints the Python path, the pip path, and version info for any packages you name - all inside the node, as a plain string output you can also wire anywhere.

    The mechanism is honest, boring Python. sys.executable gives the interpreter path; the pip path is derived as Scripts/pip.exe next to it (with a fallback to pip.exe); and package versions come from importlib.metadata.version() with a pip show fallback. Set 全部包列表 (full package list) on and it shells out to pip list and dumps every installed package. The author added it in the 2026.04 update with a note that printing the Python path is "sometimes very useful!" - and it is, because so many "my node won't import X" disasters come down to pip-installing into the wrong interpreter.

    What to set

    • 包名称 - STRING, default torch. Comma-separated names to check. The tooltip notes it auto-shows the Python version too.
    • 全部包列表 - BOOLEAN. On = dump every installed package (pip-list style).

    Outputs: Python路径 (STRING), pip路径 (STRING), 包版本信息 (STRING).

    The workflow that saves you an hour

    You cloned a node that needs a package; ComfyUI throws ModuleNotFoundError; you ran pip install and it still fails. That's this node's moment. Run it, read the pip path, and you'll find you've been installing into the system Python while ComfyUI runs a venv. Then:

    <the pip path printed by the node> install <package>
    

    Wire 包版本信息 into a text node if you want it on screen permanently, or just read the node body. This is a diagnostic tool, not a daily-driver - you'll reach for it three times a year and each time it pays for itself.

    One honest note: this is a Chinese-first UI from a 160+-node one-person pack (translation patch in the README if you need it), and the node is exactly as deep as it looks - it doesn't manage environments or install anything for you, it tells you where you are. For the install-it-for-you part, that's what ComfyUI Manager's dependency handling is for.

    Install

    ComfyUI Manager → search ComfyUI-ZML-Image, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    restart. No models, no extra deps - it uses only sys, os, and subprocess from the standard library. You can even run this node with zero GPU load, which is exactly why it's the first thing to drop into a broken workflow.

    Categoryimage/ZML_图像/工具

    Inputs (2)

    NameTypeDefaultDescription
    包名称STRINGtorch要检查的包名称,可用英文逗号分隔多个包名。会自动显示Python版本
    全部包列表BOOLEANfalse开启后显示所有已安装的包列表(类似pip list)

    Outputs (3)

    NameTypeDescription
    Python路径STRING
    pip路径STRING
    包版本信息STRING