重现步骤:
在GPU上打开新的Colab笔记本
!ls #works
!pip install -q turicreate
import turicreate as tc
!ls #doesn't work
我得到以下错误:
---------------------------------------------------------------------------
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
不幸的是,这对我来说没有什么意义,为什么会发生这种情况。有什么线索吗?我也会在turicreate项目中发布一个潜在的问题。
编辑:
它看起来确实像是覆盖了我在评论中所建议的语言环境。在导入之前,我可以执行以下操作:
import locale
locale.getdefaultlocale()
(en_US, UTF-8)
但是在我得到之后:
locale.getdefaultlocale()
(None, None)
虽然我不确定如何重置语言环境,因为我已经不能使用shell命令了?
发布于 2019-06-05 01:36:50
这是Turicreate的一个问题。相关问题在此处打开:https://github.com/apple/turicreate/issues/1862
总结如下:在启动turicreate sets the LC_ALL environment variable to C ()时。
解决此问题的方法是:
import turicreate as tc
import os
del os.environ['LC_ALL']
https://stackoverflow.com/questions/56081324
复制相似问题