简体   繁体   English

Pecl / Python:不支持的语言环境设置 - Ubuntu 13.10

[英]Pecl / Python: unsupported locale setting - Ubuntu 13.10

I want to install pecl ssh2 extension. 我想安装pecl ssh2扩展。 But when i try: 但当我尝试:

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

I'v tried everything, yes everything that i found on google! 我尝试了一切,是我在谷歌上发现的一切!

What i'v tried: 我试过的:

1- On the terminal 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- Editing environment (/etc/environment) 2-编辑环境(/ etc / environment)

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

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

LANG="en_US.UTF-8"

4- apt-get update & upgrade 4- apt-get更新和升级

5- Rebooting system 5-重启系统

locale command: locale命令:

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=

You need to give following command : 您需要提供以下命令:

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

This should fix your problem. 这应该可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM