【问题标题】:Pecl / Python: unsupported locale setting - Ubuntu 13.10Pecl / Python:不支持的区域设置 - Ubuntu 13.10
【发布时间】:2014-11-13 19:03:08
【问题描述】:

我想安装 pecl ssh2 扩展。但是当我尝试时:

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.3.2 final 0
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.3/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

我什么都试过了,是的,我在谷歌上找到的所有东西!

我试过的:

1- 在终端上

export LANGUAGE=en_US.UTF-8 
export LANG=en_US.UTF-8 
export LC_ALL=en_US.UTF-8 
locale-gen en_US.UTF-8 
dpkg-reconfigure locales

2- 编辑环境(/etc/environment)

LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"

3- 编辑区域设置(/etc/default/locale)

LANG="en_US.UTF-8"

4- apt-get 更新和升级

5- 重启系统

语言环境命令:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

【问题讨论】:

  • 区域设置不支持 LC_ALL,正如您在消息“区域设置:无法将 LC_ALL 设置为默认区域设置:没有这样的文件或目录”中看到的那样。取消设置 LC_ALL,你或许可以摆脱困境。

标签: python linux ubuntu locale pecl


【解决方案1】:

你需要给出以下命令:

sudo apt-get install language-pack-en-base -y && sudo locale-gen en_US en_US.UTF-8 && sudo dpkg-reconfigure locales

这应该可以解决您的问题。

【讨论】:

    猜你喜欢
    • 2016-08-25
    • 2021-04-27
    • 2016-07-23
    • 2016-09-02
    • 2013-12-17
    • 1970-01-01
    • 2020-04-23
    • 2021-08-01
    • 2012-02-18
    相关资源
    最近更新 更多