AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
140.67k stars 26.61k forks source link

[Bug]: NameError: name 'index_url' is not defined #8285

Open 1TommyDragon1 opened 1 year ago

1TommyDragon1 commented 1 year ago

Is there an existing issue for this?

What happened?

When I run webui-user.bat I get error:

NameError: name 'index_url' is not defined

I am using python-3.10.6150.1013

Steps to reproduce the problem

  1. Run webui-user.bat
  2. Write in additional launch options - "--skip-torch-cuda-test" (because without this command, the program does not work for me)
  3. Wait

What should have happened?

f

Commit where the problem happens

Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No

List of extensions

No

Console logs

Cancel
venv "G:\A1111\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
Traceback (most recent call last):
  File "G:\A1111\stable-diffusion-webui\launch.py", line 360, in <module>
    prepare_environment()
  File "G:\A1111\stable-diffusion-webui\launch.py", line 275, in prepare_environment
    run_pip(f"install {gfpgan_package}", "gfpgan")
  File "G:\A1111\stable-diffusion-webui\launch.py", line 136, in run_pip
    index_url_line = f' --index-url {index_url}' if index_url != '' else ''
NameError: name 'index_url' is not defined

Additional information

No

missionfloyd commented 1 year ago

index_url is indeed defined. Does it happen without the launcher?

JohnSiris commented 1 year ago

I am having the exact same issue, which started immediately after adding the aesthetic gradient extension in webUI.

Merrcurys commented 1 year ago

Make sure that the line 15 in the launch.py file looks like this: index_url = os.environ.get('INDEX_URL', "")

It is possible that you have changed the contents of this file when you tried to add --skip-torch-cuda-test. I've seen tutorials that suggest inserting --skip-torch-cuda-test into the line 15 in this file, while --skip-torch-cuda-test should have been added to the webui-user.bat file.

Thanks!