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

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

Open
mahmut-ozdemir opened this issue Apr 13, 2023 · 15 comments
Open

Comments

@mahmut-ozdemir
Copy link

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()

@strauzen
Copy link

strauzen commented May 7, 2023

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

@mahmut-ozdemir
Copy link
Author

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()

@abhishekkrthakur
Copy link
Owner

im running python 3.8 and i dont have this issue.

@strauzen
Copy link

strauzen commented May 7, 2023

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
Copy link

strauzen commented May 7, 2023

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.

@abhishekkrthakur
Copy link
Owner

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

@strauzen
Copy link

strauzen commented May 7, 2023

Yes

@mahmut-ozdemir
Copy link
Author

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

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

@strauzen
Copy link

strauzen commented May 7, 2023

Thanks, will check tomorrow.

@strauzen
Copy link

strauzen commented May 8, 2023

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

@tensor5g
Copy link

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

@Luh-code
Copy link

Luh-code commented Jul 24, 2023

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).

@mahmut-ozdemir
Copy link
Author

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.

@Luh-code
Copy link

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
Copy link

Luh-code commented Jul 24, 2023

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants