[Python] ImportError: Failed to import custom modules from {'imports': ['yolo_world'],...

Discussão em 'Python' iniciado por Stack, Junho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to run a YOLO-World V2 demo script inside a Docker/Buildah container, but I’m getting an import error related to a custom module:

    ImportError: Failed to import custom modules from {'imports': ['yolo_world'], 'allow_failed_imports': False} Here is the current sys.path:

    /repos/yoloworld-fnv/demo
    /repos/yoloworld-fnv
    /usr/lib/python38.zip
    /usr/lib/python3.8
    /usr/lib/python3.8/lib-dynload
    /usr/local/lib/python3.8/dist-packages
    /usr/lib/python3/dist-packages
    /usr/local/lib/python3.8/dist-packages/setuptools/_vendor
    It seems that Python cannot find the yolo_world module. The error suggests that I need to set the PYTHONPATH so that it includes the directory containing the module.


    What I’ve Tried;

    • I verified that the yolo_world directory exists under /repos/yoloworld-fnv/.
    • Tried running the script directly inside the container.
    • Using Python 3.8 inside a CUDA-enabled container. Question How can I properly set PYTHONPATH inside the container or in the Dockerfile so that Python recognizes the yolo_world module?

    Any help would be appreciated!

    Continue reading...

Compartilhe esta Página