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]: Networkx version error on Ubuntu 20.04 #16256

Open
1 of 6 tasks
Ken-g6 opened this issue Jul 24, 2024 · 3 comments
Open
1 of 6 tasks

[Bug]: Networkx version error on Ubuntu 20.04 #16256

Ken-g6 opened this issue Jul 24, 2024 · 3 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@Ken-g6
Copy link

Ken-g6 commented Jul 24, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

On executing a freshly downloaded copy of webui.sh, it tries to grab networkx-3.2.1 which is not compatible with Python 3.8.

Steps to reproduce the problem

  1. sudo apt install wget git python3 python3-venv
  2. wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh > sd-webui.sh
  3. bash sd-webui.sh

What should have happened?

WebUI should have been installed.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

That didn't work either:

$ bash sd-webui.sh --dump-sysinfo

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on ken user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.31
Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)
Traceback (most recent call last):
  File "launch.py", line 48, in <module>
    main()
  File "launch.py", line 29, in main
    filename = launch_utils.dump_sysinfo()
  File "/userfiles/ken/ai/stable-diffusion-webui/modules/launch_utils.py", line 473, in dump_sysinfo
    from modules import sysinfo
  File "/userfiles/ken/ai/stable-diffusion-webui/modules/sysinfo.py", line 8, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'

Console logs

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on ken user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.31
Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)
Python 3.8.10 (default, Mar 25 2024, 10:42:49) 
[GCC 9.4.0]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Collecting torch==2.1.2
  Using cached https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp38-cp38-linux_x86_64.whl (2200.7 MB)
Collecting torchvision==0.16.2
  Using cached https://download.pytorch.org/whl/cu121/torchvision-0.16.2%2Bcu121-cp38-cp38-linux_x86_64.whl (6.9 MB)
Collecting networkx
  Using cached https://download.pytorch.org/whl/networkx-3.2.1-py3-none-any.whl (1.6 MB)
ERROR: Package 'networkx' requires a different Python: 3.8.10 not in '>=3.9'
Traceback (most recent call last):
  File "launch.py", line 48, in <module>
    main()
  File "launch.py", line 39, in main
    prepare_environment()
  File "/userfiles/ken/ai/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 "/userfiles/ken/ai/stable-diffusion-webui/modules/launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/userfiles/ken/ai/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu121
Error code: 1


### Additional information

See also https://github.com/mlcommons/inference/issues/1697 which seems to reference the same bug.

I was able to install `pip3 install torch torchvision torchaudio` but I can't see how to translate that to your config files for python3-venv.
@Ken-g6 Ken-g6 added the bug-report Report of a bug, yet to be confirmed label Jul 24, 2024
@viking1304
Copy link
Contributor

viking1304 commented Jul 24, 2024

Update:

Add deadsnakes/ppa

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update

Install python 3.10

sudo apt install python3.10 python3.10-venv

Open webui-user.sh and find this

# python3 executable
#python_cmd="python3"

Replace with

# python3 executable
python_cmd="python3.10"

Remove venv folder from /userfiles/ken/ai/stable-diffusion-webui

Run ./webui.sh

After the release of a new version of A1111, there will be no need to change python version in webui-user.sh anymore #16092

@Ken-g6
Copy link
Author

Ken-g6 commented Jul 24, 2024

@viking1304 Couldn't find any package by glob 'python3.10'. I can't find anything resembling that version in Synaptic either.

@viking1304
Copy link
Contributor

@viking1304 Couldn't find any package by glob 'python3.10'. I can't find anything resembling that version in Synaptic either.

I am sorry, I misread your system version. I though it is Ubuntu 22.

For 20 and 24 you need to add deadsnakes/ppa first.

I updated my previous answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants