首页 > 解决方案 > ValueError:未知语言环境:用于导入 spacy 的 UTF-8

问题描述

当我在 mac 上导入 spacy (python) 时,给我 ValueError: unknown locale: UTF-8 我找到对我说的答案:他说:我在下面写推荐

$ .bash_profile
$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8

但它不起作用。

标签: pythonmacosutf-8spacy

解决方案


我找到了答案:当我写信~/.bash_profile给我时:

-bash: /Users/apple/.bash_profile: Permission denied

但我应该写:

$ sudo Console ~/.bash_profile 

或者

$ sudo edit ~/.bash_profile

并继续:

$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8

并运行....


推荐阅读