Steps to reproduce:
Open new Colab notebook on GPU
!ls #works
!pip install -q turicreate
import turicreate as tc
!ls #doesn't work
I get the following error:
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-22-16fdbe588ee8> in <module>()
----> 1 get_ipython().system('ls')
2 # !nvcc --version
2 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output)
165 if locale_encoding != _ENCODING:
166 raise NotImplementedError(
--> 167 'A UTF-8 locale is required. Got {}'.format(locale_encoding))
168
169 parent_pty, child_pty = pty.openpty()
NotImplementedError: A UTF-8 locale is required. Got ANSI_X3.4-1968
I'm not certain what might be going on or how to work around it. Thanks!
I can reproduce this issue. It happens when using a GPU and when not using a GPU. It happens on both Python 2 and 3. I've also verified that it is not caused by any dependencies of TuriCreate; installing each one separately still allows you to run system commands.
This seems to be an issue with locale settings. On start up turicreate sets the LC_ALL environment variable to C. For reason I don't understand this breaks Colab. Removing that environment variable seems to fix things.
As a temporary work around, please try the following:
import turicreate as tc
import os
del os.environ['LC_ALL']
This workaround resolved the UTF-8 issue, thank you!
Resolved with https://github.com/apple/turicreate/pull/2174.
Most helpful comment
I can reproduce this issue. It happens when using a GPU and when not using a GPU. It happens on both Python 2 and 3. I've also verified that it is not caused by any dependencies of TuriCreate; installing each one separately still allows you to run system commands.
This seems to be an issue with locale settings. On start up turicreate sets the
LC_ALLenvironment variable toC. For reason I don't understand this breaks Colab. Removing that environment variable seems to fix things.As a temporary work around, please try the following: