Fedora 39: Stable Diffusion Automatic1111 : INCOMPATIBLE PYTHON VERSION error

1k views Asked by At

Good day.

I'm having a bit of a problem running stable diffusion on Fedora 39

My system info:

Kernel: 6.5.6-300.fc39.x86_64 arch: x86_64 bits: 64
    Console: pty pts/1 Distro: Fedora release 39 (Thirty Nine)
Machine:
  Type: Laptop System: LENOVO product: 82N6 v: Legion 7 16ACHg6
    serial: 
  Mobo: LENOVO model: LNVNB161216 v: NO DPK serial:  UEFI: LENOVO
    v: GKCN60WW date: 03/07/2023
Battery:
  ID-1: BAT0 charge: 47.4 Wh (60.0%) condition: 79.0/80.0 Wh (98.7%)
CPU:
  Info: 8-core model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 814 min/max: 400/3201 cores: 1: 512 2: 400 3: 400 4: 400
    5: 456 6: 2196 7: 400 8: 2518 9: 400 10: 400 11: 400 12: 456 13: 512 14: 400
    15: 400 16: 2781
Graphics:
  Device-1: NVIDIA GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB]
    driver: nvidia v: 535.113.01
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
  Device-3: Bison Integrated Camera driver: uvcvideo type: USB
  Display: server: X.Org v: 23.2.1 with: Xwayland v: 23.2.1 driver: X:
    loaded: amdgpu,nvidia unloaded: fbdev,modesetting,nouveau,vesa dri: radeonsi
    gpu: amdgpu resolution: 1920x1200~60Hz
  API: OpenGL v: 4.6 Mesa 23.2.1 renderer: AMD Radeon Graphics (renoir LLVM
    16.0.6 DRM 3.54 6.5.6-300.fc39.x86_64)`

It used to run fine on Fedora 38, but now it complains about the wrong Python version and I have no idea how to make it work.

The error message:

/webui.sh
 
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
 
################################################################
Running on semela user
################################################################
 
################################################################
Create and activate python venv
################################################################
 
################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
=============================================================================================
INCOMPATIBLE PYTHON VERSION
 
This program is tested with 3.10.6 Python, but you have 3.12.0.
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/
 
 
 
Use --skip-python-version-check to suppress this warning.
=============================================================================================
Python 3.12.0 (main, Oct  2 2023, 00:00:00) [GCC 13.2.1 20230918 (Red Hat 13.2.1-3)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118
ERROR: Could not find a version that satisfies the requirement torch==2.0.1 (from versions: none)
ERROR: No matching distribution found for torch==2.0.1
 
[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip
Traceback (most recent call last):
  File "/home/semela/stable_diffusion/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/home/semela/stable_diffusion/stable-diffusion-webui/launch.py", line 39, in main
    prepare_environment()
  File "/home/semela/stable_diffusion/stable-diffusion-webui/modules/launch_utils.py", line 352, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/semela/stable_diffusion/stable-diffusion-webui/modules/launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/home/semela/stable_diffusion/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118
Error code: 1

I tried to do the following:

  1. I installed pyton3.10
  2. I edited the file webui-user.sh and changed
#python3 executable
#python_cmd="python"

to

#python3 executable
#python_cmd="python3.10"

After that I deleted venv folder and tried to run webui.sh again,but it didn't help.

What did I miss?

Thank you

2

There are 2 answers

0
krisstinkou On

If the error remains the same perhaps despite the fact you installed Python 3.10, the script executed with 3.12 (perhaps). Try to uninstall ALL python versions and install 3.10 again. After that, remove venv and create it again.

0
hayesgm On

I believe you need to simply uncomment the python_cmd flag, e.g.

#python3 executable
python_cmd="python3.10"

Notice the lack of "#" on the second line.