Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'inference' when installing on macOS #4

Open
alessandroperilli opened this issue Feb 21, 2024 · 2 comments
Open

No module named 'inference' when installing on macOS #4

alessandroperilli opened this issue Feb 21, 2024 · 2 comments

Comments

@alessandroperilli
Copy link

alessandroperilli commented Feb 21, 2024

Hi. Thanks for this new great custom node!

The node suite, installed it via ComfyUI Manager, fails to import due to the following error:

File "/ComfyUI/nodes.py", line 1887, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/init.py", line 1, in
from . import YOLO_WORLD_EfficientSAM
File "/ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/YOLO_WORLD_EfficientSAM.py", line 9, in
from inference.models import YOLOWorld
ModuleNotFoundError: No module named 'inference'

Cannot import /ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM module for custom nodes: No module named 'inference'

I believe this is because I am on Apple M2 and the requirement.txt is looking for an inference-gpu package that is not available for macOS.

As I read on PyPI, perhaps the requirement can be modified to also install the inference package?

Thank you

@alessandroperilli alessandroperilli changed the title No module named 'inference' No module named 'inference' when installing on macOS Feb 21, 2024
@huangqiaobo
Copy link

huangqiaobo commented Mar 28, 2024

after run pip install interence
get new error:
ImportError: cannot import name 'YOLOWorld' from 'inference.models'

edit YOLO_WORLD_EfficientSAM.py can resolve the error

- from inference.models import YOLOWorld
+ from inference.models.yolo_world import YOLOWorld

then get new error

ModuleNotFoundError: No module named 'clip'
module 'clip' has no attribute 'clip'

fix it

pip install git+https://github.com/openai/CLIP.git

@LiMingHuaGit
Copy link

LiMingHuaGit commented Apr 2, 2024

As a complement, edit requirements.txt to

inference[yolo-world]==0.9.20

and edit YOLO_WORLD_EfficientSAM.py can resolve the error

- from inference.models import YOLOWorld
+ from inference.models.yolo_world import YOLOWorld

and run

pip install -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants