AUTOMATIC1111 / stable-diffusion-webui

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

Why can't I use the newest python??????? #15313

Open Kenfin7 opened 5 months ago

Kenfin7 commented 5 months ago

Checklist

What happened?

It said I needed the older version of python, 3.10

Steps to reproduce the problem

Idk

What should have happened?

It should've worked

What browsers do you use to access the UI ?

Google Chrome, Microsoft Edge, Other

Sysinfo

Huh?

Console logs

venv "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\venv\Scripts\Python.exe"
==============================================================================================================
INCOMPATIBLE PYTHON VERSION

This program is tested with 3.10.6 Python, but you have 3.12.2.
If you encounter an error with "RuntimeError: Couldn't install torch." message,
or any other error regarding unsuccessful package (library) installation,
please downgrade (or upgrade) to the latest version of 3.10 Python
and delete current Python and "venv" folder in WebUI's directory.

You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3106/

Alternatively, use a binary release of WebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases

Use --skip-python-version-check to suppress this warning.
==============================================================================================================
Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)]
Version: v1.8.0
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
ERROR: Could not find a version that satisfies the requirement torch==2.1.2 (from versions: 2.2.0, 2.2.0+cu121, 2.2.1, 2.2.1+cu121)
ERROR: No matching distribution found for torch==2.1.2
Traceback (most recent call last):
  File "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
  File "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\launch.py", line 39, in main
    prepare_environment()
  File "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\modules\launch_utils.py", line 380, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\modules\launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "C:\Users\kenne\Kenne's Desktop\Stable Diffusion Web-UI\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu121
Error code: 1
Press any key to continue . . .

Additional information

I have python 3.12

missionfloyd commented 5 months ago

Uninstall 3.12, install 3.10. https://www.python.org/downloads/release/python-31011/ https://apps.microsoft.com/detail/9pjpw5ldxlz5

If you need python 3.12 for something else, you can install both versions, then specify python 3.10 in webui-user.bat.

set PYTHON=python3.10.exe

Either way, delete the venv folder so it creates a new one with 3.10.

Or you can use this. It includes python 3.10. Run update.bat, then start.bat.

Dalton-Murray commented 5 months ago

For future note, I am currently running 1.8.0 and I am safely running with 3.11.7.

marigoold commented 5 months ago

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

thiagojramos commented 4 months ago

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

Is there any benefit to running on 3.12?

marigoold commented 4 months ago

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

Is there any benefit to running on 3.12?

I think there is no significant benefit in using python3.12, but if you have been using python3.12 and switch from python3.12 to python3.10, many dependencies need to be reinstalled, which is a bit cumbersome

Rabcor commented 3 months ago

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

no you can't, you'll just get a tokenizers error next.

the real issue imo isn't that you can't use the newest version of python, but that sd-webui tries to use the system version of python when it can, so if the system version of python is not 3.10 or 3.11 sd-webui breaks itself when it should instead just be downloading 3.10 to create the venv with on it's first run instead.

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

Is there any benefit to running on 3.12?

I think there is no significant benefit in using python3.12, but if you have been using python3.12 and switch from python3.12 to python3.10, many dependencies need to be reinstalled, which is a bit cumbersome

You can have multiple versions of python installed at the same time, and sd-webui uses the one in it's venv folder, so something like python3.10 -m venv /path/to/sd/venv would allow you to use that for the webui without changing anything for ur system.

Mrothyr commented 3 months ago

Install Python 3.10.6 (Newer version of Python does not support torch)"

And why 3.10.6? I have latest 3.10 - what the problem with it?

Rabcor commented 3 months ago

Install Python 3.10.6 (Newer version of Python does not support torch)"

And why 3.10.6? I have latest 3.10 - what the problem with it?

actually you should probably be using 3.11, it's faster, and it works just fine with the webui, and torch.

It's just 3.12 that's actually broken right now.

you can continue use Python3.12, just install pytorch manually by command like pip install torch==2.2.0+cu121, and add param --skip-python-version-check when you start sd-webui service.

Is there any benefit to running on 3.12?

I think there is no significant benefit in using python3.12, but if you have been using python3.12 and switch from python3.12 to python3.10, many dependencies need to be reinstalled, which is a bit cumbersome

As I said, 3.11 is considerably faster than older versions, it got some major performance improvements, so that's a good enough reason to use 3.11 over 3.10, not sure about 3.12 though.

Dalton-Murray commented 3 months ago

Since I'm still subscribed to this thread, I will update: I am smoothly running on 3.12.3

thiagojramos commented 3 months ago

Digressing about what's been discussed in this topic: I don't know why (I really don't) people still list Python 3.10 and CUDA 11.8 as requirements. Is it some kind of compatibility issue?

Dalton-Murray commented 3 months ago

Digressing about what's been discussed in this topic: I don't know why (I really don't) people still list Python 3.10 and CUDA 11.8 as requirements. Is it some kind of compatibility issue?

People think they're listed as requirements because that's what's "officially" on documentation/everywhere you search, it definitely works with newer python and CUDA software/drivers

thiagojramos commented 3 months ago

Since I'm still subscribed to this thread, I will update: I am smoothly running on 3.12.3

Is there already PyTorch, audio, and that other one I forgot the name now with CUDA support for Py 3.12? And what about xformers too? I remember that about 2 months ago (around that time) when I went looking, there were some packages that only had the CPU version available.

Dalton-Murray commented 3 months ago

Since I'm still subscribed to this thread, I will update: I am smoothly running on 3.12.3

Is there already PyTorch, audio, and that other one I forgot the name now with CUDA support for Py 3.12? And what about xformers too? I remember that about 2 months ago (around that time) when I went looking, there were some packages that only had the CPU version available.

PyTorch has worked with Python 3.12 and Cuda support for at least a couple of months (nightly build) and has been for as far as I know at least a month been in official builds/releases. Also transformers and other things have had support for a while too from what I know

It looks like some PRs are working on adapting current stuff to python 3.12 already as well (I should probably help and PR my working one) (seems like to me at least that PRs are getting artificially slowed down, and haven't seen automatic1111 work on major updates themselves in a while (they're probably really busy with other stuff no hate) )

sybux commented 2 months ago

Since I'm still subscribed to this thread, I will update: I am smoothly running on 3.12.3

can you please explain here how you succeed in using 3.12.3 ? I'm trying to but got problem with pyTorh:

ERROR: Could not find a version that satisfies the requirement torch==2.1.2

As for some users asking, python 3.10. is out of support and got security issue. This is THE reason to left this build.

thiagojramos commented 2 months ago

Since I'm still subscribed to this thread, I will update: I am smoothly running on 3.12.3

can you please explain here how you succeed in using 3.12.3 ? I'm trying to but got problem with pyTorh:

ERROR: Could not find a version that satisfies the requirement torch==2.1.2

As for some users asking, python 3.10. is out of support and got security issue. This is THE reason to left this build.

https://[download.pytorch.org/whl/nightly/](https://download.pytorch.org/whl/nightly/)