diffuzers icon indicating copy to clipboard operation
diffuzers copied to clipboard

"UnicodeDecodeError: 'charmap' codec can't decode..." setup.py

Open mahmut-ozdemir opened this issue 2 years ago • 15 comments

Error message: "subprocess-exited-with-error"

The error message "subprocess-exited-with-error" indicates that a subprocess being run by pip has failed. Specifically, in this case, it seems to be related to an issue with the metadata generation of a Python package.

The error message further explains that when attempting to read the long_description element in the setup.py file, a UnicodeDecodeError occurred. This usually happens when the character encoding is not specified correctly.

To resolve this issue, make sure that the character encoding is specified correctly when reading the long_description element in the setup.py file. For instance, if your file is assumed to be encoded with UTF-8, you can use the following code:

with open('README.md', encoding='utf-8') as f: long_description = f.read()

mahmut-ozdemir avatar Apr 13 '23 22:04 mahmut-ozdemir

Is there a workaround for this issue? I am currently stuck in running diffuzers due to this. When running the app.

strauzen avatar May 07 '23 19:05 strauzen

Is there a workaround for this issue? I am currently stuck in running diffuzers due to this. When running the app

Open setup.py and found this code line "with open('README.md.... "

Change it with this

with open('README.md', encoding='utf-8') as f: long_description = f.read()

mahmut-ozdemir avatar May 07 '23 19:05 mahmut-ozdemir

im running python 3.8 and i dont have this issue.

abhishekkrthakur avatar May 07 '23 19:05 abhishekkrthakur

Yes that I did, but after the installation whenever I try to run the app I get a similar error related, I think, to the same issue: F:\StableDiffussion\diffuzers> diffuzers app 2023-05-07 21:25:33.199 'charmap' codec can't encode character '\U0001f44b' in position 4: character maps to <undefined>

strauzen avatar May 07 '23 19:05 strauzen

Interesting, I am currently running python 3.10, will give a try to run it with 3.8 later. Will come back if that works.

strauzen avatar May 07 '23 19:05 strauzen

3.10 also without issues on my end. are you on windows?

abhishekkrthakur avatar May 07 '23 19:05 abhishekkrthakur

Yes

strauzen avatar May 07 '23 19:05 strauzen

https://symbl.cc/en/search/?q=%5CU0001f44b

It's wawing hand emoji, you can delete it in the README.md

mahmut-ozdemir avatar May 07 '23 19:05 mahmut-ozdemir

Thanks, will check tomorrow.

strauzen avatar May 07 '23 19:05 strauzen

I deleted the emoji from all the readme files I could find related to diffuzers but still no luck, same problem.

strauzen avatar May 08 '23 06:05 strauzen

Is there a workaround for this issue? I am currently stuck in running diffuzers due to this. When running the app

Open setup.py and found this code line "with open('README.md.... "

Change it with this

with open('README.md', encoding='utf-8') as f: long_description = f.read()

This resolved the issue for me. Coda/Python3.10 on Windows

tensor5g avatar May 19 '23 01:05 tensor5g

Is there a workaround for this issue? I am currently stuck in running diffuzers due to this. When running the app

Open setup.py and found this code line "with open('README.md.... " Change it with this with open('README.md', encoding='utf-8') as f: long_description = f.read()

This resolved the issue for me. Coda/Python3.10 on Windows

Where am I supposed to put this line?

Propably a really stupid question, but I don't really use python all to often. Also I ran the README.md in the github though this website to remove all non-ascii characters, which allowed me to install diffuzers in the first place (I installed it via git and the error was referencing some other character). Now I get the error again when running diffuzers run (This time with the exact char dicussed in the thread).

Just out of desperation I also ran a powershell command to remove all occurences of 👋 from all .txt and .md files in my python 3.11 folder, which didn't fix anything either...

I tried Python 3.7 and 3.10 through Anaconda, where I installed diffuzers via pip. And now I am using Pyhton 3.11 without Anaconda and installed diffuzers via git (on windows).

Luh-code avatar Jul 24 '23 14:07 Luh-code

Is there a workaround for this issue? I am currently stuck in running diffuzers due to this. When running the app

Open setup.py and found this code line "with open('README.md.... " Change it with this with open('README.md', encoding='utf-8') as f: long_description = f.read()

This resolved the issue for me. Coda/Python3.10 on Windows

Where am I supposed to put this line?

Propably a really stupid question, but I don't really use python all to often. Also I ran the README.md in the github though this website to remove all non-ascii characters, which allowed me to install diffuzers in the first place (I installed it via git and the error was referencing some other character). Now I get the error again when running diffuzers run (This time with the exact char dicussed in the thread).

Just out of desperation I also ran a powershell command to remove all occurences of 👋 from all .txt and .md files in my python 3.11 folder, which didn't fix anything either...

I tried Python 3.7 and 3.10 through Anaconda, where I installed diffuzers via pip. And now I am using Pyhton 3.11 without Anaconda and installed diffuzers via git (on windows).

You can found it in setup.py. starting with "with open('README.md',..." in the code change this line.

mahmut-ozdemir avatar Jul 24 '23 14:07 mahmut-ozdemir

Yes that I did, but after the installation whenever I try to run the app I get a similar error related, I think, to the same issue: F:\StableDiffussion\diffuzers> diffuzers app 2023-05-07 21:25:33.199 'charmap' codec can't encode character '\U0001f44b' in position 4: character maps to <undefined>

Thanks, but it still doesn't work... I changed it for reading requirements.txt aswell, but it didnt help (yes I reinstalled it after changing the code). The comment I am quoting is the exact error I get.

Luh-code avatar Jul 24 '23 15:07 Luh-code

Ok, so I just figured it out. For some weird reason, the command prompt/powershell window isn't allowed to be admin. If I run the command from a normal cmd prompt it appears to work...

Luh-code avatar Jul 24 '23 15:07 Luh-code