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

[Bug]: ModuleNotFoundError: No module named 'segment_anything' #1

Closed
1 task done
halumice opened this issue Apr 10, 2023 · 10 comments
Closed
1 task done

[Bug]: ModuleNotFoundError: No module named 'segment_anything' #1

halumice opened this issue Apr 10, 2023 · 10 comments

Comments

@halumice
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

after instalation. Trying to reproduce video guide.

Looks like a python prerequisite.

Steps to reproduce the problem

  1. Lauch webUI and see the message

What should have happened?

Normal launch, extension "section" should be in img2img but it is not

Commit where the problem happens

webui: 22bcc7b
controlnet:

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

set COMMANDLINE_ARGS=--xformers --medvram

Console logs

Traceback (most recent call last):
  File "E:\Files\SD_auto\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "E:\Files\SD_auto\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\Files\SD_auto\stable-diffusion-webui\extensions\sd-webui-segment-everything\scripts\sam.py", line 20, in <module>
    from segment_anything import SamPredictor, build_sam
ModuleNotFoundError: No module named 'segment_anything'

Additional information

No response

@continue-revolution
Copy link
Owner

You may either manually pip install segment_anything on your terminal or update to the new version. The current version should be able to automatically do pip install for you. If not, pls lemme know.

@halumice
Copy link
Author

I installed manually with pip install because it was not getting installed automatically
imagen

But anyways:
imagen

Any advice?

Thanks, I think your extension will be a turning point in inpainting

@continue-revolution
Copy link
Owner

The reason might be because your sd-webui python environment is using a different python environment. I have replaced my automatic pip install script with the global run_pip, could you try again?

@halumice
Copy link
Author

Yep! It is fixed now. Thanks!

@byames
Copy link

byames commented Apr 10, 2023

The reason might be because your sd-webui python environment is using a different python environment. I have replaced my automatic pip install script with the global run_pip, could you try again?

how do you do that?
I'm getting this:

ModuleNotFoundError: No module named 'modules.paths_internal'

@continue-revolution
Copy link
Owner

The reason might be because your sd-webui python environment is using a different python environment. I have replaced my automatic pip install script with the global run_pip, could you try again?

how do you do that? I'm getting this:

ModuleNotFoundError: No module named 'modules.paths_internal'

This is because you have not updated your SD webui to the newest version. You should probably add this file under ${webui}/modules. Not sure whether it will work. If it is not working, let me know.

@byames
Copy link

byames commented Apr 10, 2023

Thank you!
Is there a way to automatically update it upon opening the 1111 webui?
I thought git pill did that in the webui-user file

@continue-revolution
Copy link
Owner

continue-revolution commented Apr 10, 2023

Thank you! Is there a way to automatically update it upon opening the 1111 webui? I thought git pill did that in the webui-user file

Yes. Run git pull under your ${webui} directory is all you need. You should safely do that. At least this update does not bring me trouble.

@ljleb
Copy link

ljleb commented Apr 10, 2023

Consider installing the requirements in the install.py file: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions

@continue-revolution
Copy link
Owner

Consider installing the requirements in the install.py file: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions

Done

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

4 participants