Error Initalizing Stable diffusion with python 3.10.6. 'str' object has no attribute 'isascii'


I’m trying to set Up Stable Diffusion 1.5 from GIT
I’ve followed a tutorial

To avoid problems with multiple python versions I’ve removed older Python version and installed only Python 3.10.6, then only 3.10.9, but I receive the same error with both versions.

When I call the web-user.bat to Initialize. The bat calls webui.bat and I receive this error:

Python 3.10.9
venv "D:Stable Diffusionstable-diffusion-webuivenvScriptsPython.exe"
Fatal Python error: Py_Initialize: unable to load the file system codec
Traceback (most recent call last):
  File "", line 85, in search_function
  File "", line 64, in normalize_encoding
AttributeError: 'str' object has no attribute 'isascii'
Premere un tasto per continuare . . .

I’ve seen this error is due to using an old python version, but I’m using the 3.10.


Asked By: Ale



The problem was I had a old version of Python when using web-user.bat for the first time. When You run the web-user.bat the first time it creates a venv folder.

The solution was to remove manually the venv folder from my Stable Diffusion folder and use again the web-user.bat.

Answered By: Ale