-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 59: invalid continuation byte #6105
Comments
@lstein - Do you think this might be system specific? |
Maybe i need to add this :
|
Yes, that seems to be the case - But that's an issue we need to fix I think |
It appears the Please open a command line window and try this command. Does it error? python -c "import subprocess; print(subprocess.check_output('echo Sombre Clarté', shell=True).decode())" Next, try this command. Does it error? python -c "import subprocess; print(subprocess.check_output('echo Sombre Clarté', shell=True).decode("utf-8"))" |
Okay,. C:\Users\Sombre Clarté>python -c "import subprocess; print(subprocess.check_output('echo Sombre Clarté', shell=True).decode())" Second : C:\Users\Sombre Clarté>python -c "import subprocess; print(subprocess.check_output('echo Sombre Clarté', shell=True).decode("utf-8"))" Indeed, the character "é" has caused me some problems since I started to get interested in scripts and everything related to artificial intelligence. I have been using my windows system for far too long, so it's too late to change. |
@cmensah I apologize, I had a typo in the second command - please try this one:
Hopefully this works without an error, and we can update the installer to handle |
Microsoft Windows [version 10.0.19045.3693] C:\Users\Sombre Clarté>python -c "import subprocess; print(subprocess.check_output('echo Sombre Clarté', shell=True).decode('utf-8'))" C:\Users\Sombre Clarté> this guy : 0x82 :) |
Oh boy, fun. We have another related issue with an unexpected encoding here: https://discord.com/channels/1020123559063990373/1020123559831539744/1225085570032865291 In this case, the user (also with French characters) is getting an error when we attempt to read their config file into memory: |
We have had a few bugs with v4 related to file encodings, especially on Windows. Windows uses its own character encodings instead of `utf-8`, often `cp1252`. Some characters cannot be decoded using `utf-8`, causing `UnicodeDecodeError`. There are a couple places where this can cause problems: - In the installer bootstrap, we install or upgrade `pip` and decode the result, using `subprocess`. The input to this includes the user's home dir. In #6105, the user had one of the problematic characters in their username. `subprocess` attempts and fails to decode the username, which crashes the installer. To fix this, we need to use `locale.getpreferredencoding()` when executing the command. - Similarly, in the model install service and config class, we attempt to load a yaml config file. If a problematic character is in the path to the file (which often includes the user's home dir), we can get the same error. One example is #6129 in which the models.yaml migration fails. To fix this, we need to open the file with `locale.getpreferredencoding()`.
We have had a few bugs with v4 related to file encodings, especially on Windows. Windows uses its own character encodings instead of `utf-8`, often `cp1252`. Some characters cannot be decoded using `utf-8`, causing `UnicodeDecodeError`. There are a couple places where this can cause problems: - In the installer bootstrap, we install or upgrade `pip` and decode the result, using `subprocess`. The input to this includes the user's home dir. In #6105, the user had one of the problematic characters in their username. `subprocess` attempts and fails to decode the username, which crashes the installer. To fix this, we need to use `locale.getpreferredencoding()` when executing the command. - Similarly, in the model install service and config class, we attempt to load a yaml config file. If a problematic character is in the path to the file (which often includes the user's home dir), we can get the same error. One example is #6129 in which the models.yaml migration fails. To fix this, we need to open the file with `locale.getpreferredencoding()`.
Is there an existing issue for this problem?
Operating system
Windows
GPU vendor
Nvidia (CUDA)
GPU model
RTX 3050
GPU VRAM
8GB
Version number
4.0.0
Browser
Chrome
Python dependencies
No response
What happened
I was trying to update to the latest version.. then this error :
***** Checking and Updating Python *****
Initializing the installer. This may take a minute - please wait...
Actual environment location may have moved due to redirects, links or junctions.
Requested location: "C:\Users\SOMBRE~1\AppData\Local\Temp\invokeai-installer-tmpwb2fytyg\Scripts\python.exe"
Actual location: "C:\Users\Sombre Clarté\AppData\Local\Temp\invokeai-installer-tmpwb2fytyg\Scripts\python.exe"
Traceback (most recent call last):
File "C:\Users\Sombre Clarté\Downloads\InvokeAI-installer-v4.0.0\InvokeAI-Installer\lib\main.py", line 50, in
inst = Installer()
^^^^^^^^^^^
File "C:\Users\Sombre Clarté\Downloads\InvokeAI-installer-v4.0.0\InvokeAI-Installer\lib\installer.py", line 48, in init
self.bootstrap()
File "C:\Users\Sombre Clarté\Downloads\InvokeAI-installer-v4.0.0\InvokeAI-Installer\lib\installer.py", line 88, in bootstrap
res = upgrade_pip(Path(venv_dir.name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Sombre Clarté\Downloads\InvokeAI-installer-v4.0.0\InvokeAI-Installer\lib\installer.py", line 319, in upgrade_pip
result = subprocess.check_output([python, "-m", "pip", "install", "--upgrade", "pip"]).decode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 59: invalid continuation byte
Appuyez sur une touche pour continuer...
What you expected to happen
Version 4.0.0
How to reproduce the problem
Start the install.bat
Additional context
No response
Discord username
No response
The text was updated successfully, but these errors were encountered: