p4trk
p4trk

Reputation: 33

I am trying to setup an Ubuntu 14.04 server but I have a local error afterwards

I have a little droplet server and I was setting up Ubuntu 14.04 on it. Afterwards, I wanted to get some things setup but I got this local problem:

File "/usr/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 19, in <module>
    sys.exit(pip.main())
  File "/usr/local/lib/python3.5/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.5/locale.py", line 595, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

You may need to use sudo to install dependencies.

Can anyone help?

Edit:

From running locale, this is what I had:

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

It was from a pip install.

Upvotes: 1

Views: 111

Answers (1)

Nikita
Nikita

Reputation: 6341

Ok, so it looks like the problem with system locale settings.

In the console run one after another:

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LANGUAGE="en_US"
pip install package_name_that_caused_an_error

if everything will work this way this time, then run in this same console (to keep the settings that you exported):

sudo dpkg-reconfigure locales

Reboot your machine and see if you'll get same errors. You shouldn't get them if everything worked.

Upvotes: 1

Related Questions