Open yyf0202 opened 4 years ago
Thank for reporting, this is probably a bug of Taichi. What's your output of running these commands:
echo LANG $LANG
echo LC_ALL $LC_ALL
locale
?
Does modifying /Library/Python/3.7/site-packages/taichi/core/util.py
in line 55 from:
return s.encode(locale.getdefaultlocale()[1])
to
return s.encode()
fix the issue?
Related issues: https://stackoverflow.com/questions/33716748/python-valueerror-unknown-locale-utf-8 https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python
Thank for replying. Modifying util.py does not work. Follow the related issues,i fixed this error by exporting environment variables.
Great! Would you mind tell me what's your original value of that two environment variables?
Of course. The output is : LANG LC_ALL LANG="" LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL=
hi,here is the logs ~/taichi-works/taichi_three master sudo python3 setup.py build install [Taichi] mode=release Traceback (most recent call last): File "setup.py", line 2, in
from taichi_three.version import version, taichi_version, taiglsl_version
File "/Users/yangyifan/taichi-works/taichi_three/taichi_three/init.py", line 1, in
import taichi_glsl as ts
File "/Library/Python/3.7/site-packages/taichi_glsl/init.py", line 5, in
import taichi as ti
File "/Library/Python/3.7/site-packages/taichi/init.py", line 1, in
from .core import
File "/Library/Python/3.7/site-packages/taichi/core/init.py", line 1, in
from .util import
File "/Library/Python/3.7/site-packages/taichi/core/util.py", line 158, in
import_ti_core()
File "/Library/Python/3.7/site-packages/taichi/core/util.py", line 47, in import_ti_core
core.set_lib_dir(locale_encode(lib_dir))
File "/Library/Python/3.7/site-packages/taichi/core/util.py", line 55, in locale_encode
return s.encode(locale.getdefaultlocale()[1])
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/locale.py", line 568, in getdefaultlocale
return _parse_localename(localename)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/locale.py", line 495, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
And my env info is: [Taichi] version 0.6.29, llvm 10.0.0, commit f1bde29b, osx, python 3.7.3 [TaiGLSL] version 0.0.8 [Tai3D] version 0.0.3