Code Monkey home page Code Monkey logo

Comments (18)

jiyuren avatar jiyuren commented on June 12, 2024 11

modify you install.py insert sys.path.append('../YOUR_PATH') the launch module is your launch.py just import it

from sd_civitai_extension.

SpacePiggy17 avatar SpacePiggy17 commented on June 12, 2024 10

Can someone properly explain how to fix it in English or make a pull request?

Python is failing to import a module. Usually, this can be solved by running "pip install " inside of the terminal but because "launch" is not a package defined in the pip repository, we cannot use pip for this. Instead, we need to specify a path where Python looks for the "launch" module. "launch.py" is a Python script in the webui and is what we need to import. So instead of finding and installing something on the internet using pip, the webui uses a file path on your computer to import the "launch.py" script.

To fix this we need to change where python is looking. Normally we would have to use pip to install a module from the internet using pip, but we want it to look on our computer. To do that simply in a Python program, we can import the "sys" package (which is defined by Python) and add a file path to where it is looking to import from. Go to the extensions folder, find this extension's folder, open the "launch.py" file (for the extension), and add this code to the top:

import sys
sys.append("your/file/path/to/a1111/here") #MAKE SURE YOU CHANGE THE FILE PATH BEFORE YOU IMPORT "LAUNCH"

Now, when the script does "from launch import run" later on, it will check the webui folder and try importing the module from there.

What "sys.append()" does, is take an input of the file path you want to add: set this to your "stable-diffusion-webui" folder (for a1111) path. Mine on Linux looks like "sys.append("/home/myname/stable-diffusion-webui")". Then after we have added the file path to a list that it checks when importing, we can import the "launch" module as done by the line later on: "from launch import run".

I find myself having to do this pretty often with new extensions if they fail to import "launch". I just go into the script and change the file path to include the a1111 webui folder and it usually works. Hope this helped. I am still learning too.

from sd_civitai_extension.

adoontheway avatar adoontheway commented on June 12, 2024 7

11111

import sys
sys.append("your/file/path/to/a1111/here") #MAKE SURE YOU CHANGE THE FILE PATH BEFORE YOU IMPORT "LAUNCH"

works for me

from sd_civitai_extension.

LanHao0 avatar LanHao0 commented on June 12, 2024 6

modify you install.py insert sys.path.append('../YOUR_PATH') the launch module is your launch.py just import it

can you please explain your answer? adding this ( even using insert(0, doesn't seem to help me

image
add it to here, I guess the launch means launch.py in the root folder.

from sd_civitai_extension.

Skysliao avatar Skysliao commented on June 12, 2024 5

same here

from sd_civitai_extension.

arditobryan avatar arditobryan commented on June 12, 2024 1

hi, i have the same problem
Additionally, requirements.txt does not have the PythonGit library which is necessary to run install.py

from sd_civitai_extension.

0Fox avatar 0Fox commented on June 12, 2024 1

Can someone properly explain how to fix it in English or make a pull request?

from sd_civitai_extension.

hypiuser avatar hypiuser commented on June 12, 2024 1
pip install --upgrade setuptools

solved my problem.

from sd_civitai_extension.

azodev avatar azodev commented on June 12, 2024

same here

from sd_civitai_extension.

SpacePiggy17 avatar SpacePiggy17 commented on June 12, 2024

Same issue here.

from sd_civitai_extension.

fsandovalz avatar fsandovalz commented on June 12, 2024

Same issue :(

from sd_civitai_extension.

jtac avatar jtac commented on June 12, 2024

modify you install.py insert sys.path.append('../YOUR_PATH') the launch module is your launch.py just import it

can you please explain your answer? adding this ( even using insert(0, doesn't seem to help me

from sd_civitai_extension.

ifiddle avatar ifiddle commented on June 12, 2024

11111

import sys
sys.append("your/file/path/to/a1111/here") #MAKE SURE YOU CHANGE THE FILE PATH BEFORE YOU IMPORT "LAUNCH"

works for me

its work, thanks!

from sd_civitai_extension.

idiotcommerce avatar idiotcommerce commented on June 12, 2024

this due to lower versions we need to add. like python 3.9 and 3.10

from sd_civitai_extension.

bruce2233 avatar bruce2233 commented on June 12, 2024

cd to your sd webui root path, run this command:

PYTHONPATH=$(pwd) python extensions/sd-webui-segment-anything/install.py

from sd_civitai_extension.

Jammers33 avatar Jammers33 commented on June 12, 2024

if the above solution isn't working for you...Windows
I like you was having many issues with 'pip install launch' and getting a reporting error of
"ERROR: Cannot install launch==0.1.0, launch==0.1.1, launch==0.1.2 and launch==0.1.3
because these package versions have conflicting dependencies. The conflict is caused by:
launch 0.1.3 depending on ,
flowdas-meta<1.1 and >=1.0.1
launch 0.1.2 depends on
flowdas-meta<1.1 and >=1.0.1
launch 0.1.1 depends on
flowdas-meta<1.1 and >=1.0.1
launch 0.1.0 depends on
flowdas-meta<1.1 and >=1.0.1
To fix this you could try to: 1. loosen the range of package versions you've specified 2. remove package versions to allow pip attempt to solve the dependen
I went ahead and downloaded the Downloading launch-0.1.3.tar.gz (10 kB) Downloading launch-0.1.2.tar.gz (10 kB) Downloading launch-0.1.1.tar.gz (10 kB) Downloading launch-0.1.0.tar.gz (7.2 kB) that the call was asking for, upon examination of the setup.py in the folder 'launch-0.1.3' the first line of 'install_requires' had the call to download flowdas to a defunct https://bitbucket.org/flowdas/launch, it simply is nonexistent and there are a lot of people that can't download it, but still need it.
I went ahead and emailed the author. After all that I went and updated my flowdas to 0.5.0 https://pypi.org/project/flowdas/
'pip install flowdas'
installed it then I went back to setup.py and changed the first three lines to update to
install_requires = [
'flowdas>=0.5.0,<0.6.0',
'click>=6.7,<6.8',
'PyYAML>=3.12,<3.13',
, to reflect all the new updated versions to be installed that includes all three lines, in the root folder of launch-0.1.3 I executed the
pip install -e .
, and wouldn't you know it installed, all of it...
Now I am not responsible for what happens if anything to your machine, as this works for me and my application and it may not work for you, best to do everything you can in a VENV. Hope that helps! bingo, bongo, bango, you're the rock star, get after it!

from sd_civitai_extension.

marketingstarz avatar marketingstarz commented on June 12, 2024

11111

import sys
sys.append("your/file/path/to/a1111/here") #MAKE SURE YOU CHANGE THE FILE PATH BEFORE YOU IMPORT "LAUNCH"

works for me

Thanks for this. This helped me out!

from sd_civitai_extension.

Consulting4J avatar Consulting4J commented on June 12, 2024

add one line before "from lauch import run"

sys.path.append('/home/rrrr/stable-diffusion-webui')

from sd_civitai_extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.