-
Notifications
You must be signed in to change notification settings - Fork 749
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
NotImplementedError: A UTF-8 locale is required. Got ANSI_X3.4-1968 #3409
Comments
@loboere Thanks for reporting the issue and thanks for using Colab. Can you provide a minimal reproducible notebook? |
I got the same error .... any solution to this yet? |
the commands triggered this error for me
|
I faced the same exception in pyannote. I solved it by overriding import locale
locale.getpreferredencoding = lambda: "UTF-8" Here is a notebook with the workaround. Update: While many people have found this workaround helpful, it is important to note that it should be regarded as a temporary solution and not considered a permanent fix. |
@karray this solution works for me. Thanks a lot |
Thanks! |
I also get this error randomly, If i have to guess its after alot of outputs that been written to the output screen |
@karray this worked for me as well! Thanks! |
In my opinion, this issue shouldn't be closed yet. While the workaround offered may serve as a temporary solution, it doesn't actually address the underlying problem. |
I agree with @karray This is not fixed and should be reopened. Encountered it just now myself. |
I also get this error randomly these two days. |
I didn't Encountered this Before. But these Week, These Happens Randomly Every now and Then... |
I got this error when I tried to install fasttext library in colab. |
I got this error when I tried to install torchvision in Colab. Thanks @karray solution worked perfectly! |
The solution from @karray worked for me! Thanks! |
The same problem appears when trying to install sentencepiece. The solution from @karray works (thanks!), but breaks other dependencies in the code (such as importing the Transformers library). |
Got this error just now. Only went away after resetting the runtime. |
Thanks a lot it works for me. |
I am encountering this error still. The posted workaround works for me. |
|
It worked. Thank you!! |
I encountered this issue today. There is a SO issue on this from 2019. |
this worked for me, thx @teddybear082 |
I also got the same issue today after completing the training of yolov8 in Google Colab. |
I encountered the same problem while attempting to download Mozilla Common Voice using |
Same here. After a quite simple YOLOv8 training. Same issue. from ultralytics import YOLO
model = YOLO('path/to/my/model.pt')
model.train(data='path/to/my/data.yaml', epochs=100, batch=16) Besides, thank you so much @karray, your solution also resolved my issue! |
it happened all of a sudden for me... in an environment that had been been working for days. I can't even tell the steps to reproduce it |
Is anyone trying to actively solve this? |
I just faced the same issue, and this temporary solution solved my problem. |
Thank you so much pal! |
This code worked for me, Thanks! |
This worked for me. Thanks! |
Had the same encoding issue with a few notebooks. This temporary fix worked. Thanks alot @karray! |
I got this error as well, temporary fix solved it, but it's been a long time, shouldn't it be solved by now? |
Just another +1 to solving this error, since I'm also encountering it seemingly-randomly. |
+1 to solving this, I can never tell when this is going to trigger and spoil my workflow. |
I resolved this for myself in Python
The difference being that my library required |
Thx a lot, it works for me |
Just ran into this issue as well! Are there any plans for a fix? |
Check the latest comments in this thread, there are a couple of variants of the solution for that error depending on the use case. It worked for me |
It would be great if this could get fixed since I've got a notebook that needs both fixes |
|
@karray Not all heroes wear capes! |
The code from @pooyaEst works also for me. |
Thank you mr. I think this best solution this probel |
It's 2025 and the same error happens for me when I install Ultralytics Yolo:
The workaround helps 👍 |
Sometimes when I execute a cell this error appears, I must restart the execution environment to eliminate the error.
NotImplementedError Traceback (most recent call last)
in
----> 1 get_ipython().system('pip install ffmpeg-python')
2 frames
/usr/local/lib/python3.8/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output)
161 locale_encoding = locale.getpreferredencoding()
162 if locale_encoding != _ENCODING:
--> 163 raise NotImplementedError(
164 'A UTF-8 locale is required. Got {}'.format(locale_encoding))
165
NotImplementedError: A UTF-8 locale is required. Got ANSI_X3.4-1968
The text was updated successfully, but these errors were encountered: