How To Fix Python Error ValueError: unknown locale: UTF-8 on macOS
- Categories:
- python
When you running Python script on Mac OS, you may occurs Python error like this one:
Solution
Edit ~/.bash_profile
if you are using bash
or ~/.zshrc
for zsh
and add these lines.
In some case, you may need to set LC_CTYPE
.
Restart your terminal or computer or run this command to reload environment variables.
To make sure it was set, check with echo
command.
- Tags:
- #python
Sponsored Links
- Register to Digital Ocean cloud with this link and get $200 credit
- Looking for cheap CDN? Bunny is the answer
- Alternative Cloud besides AWS and Digital Ocean