python: pip install xmltodict falha

2

Eu gostaria de usar o Ansible na minha máquina Ubuntu. Eu tentei usar o módulo ping e ele reclama que não encontra a biblioteca xmltodict python. Queria instalar o módulo ausente usando o pip. Quando eu tento:

pip install xmltodict

Eu recebo:

Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python2.7/locale.py", line 583, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

Estou executando o Ubuntu16.04 LTS. Como posso fazer isso? obrigado

    
por diegus 22.06.2016 / 09:55

2 respostas

4

A solução está aqui: link

Desde que eu estou executando o python2.7:

$uname -a
Linux tools1-itigo-tech 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$python --version
Python 2.7.11+
$unset LC_ALL
$pip install xmltodict
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python2.7/locale.py", line 583, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
$export LC_ALL=C
$pip install xmltodict
Collecting xmltodict
Downloading xmltodict-0.10.2.tar.gz
Building wheels for collected packages: xmltodict
Running setup.py bdist_wheel for xmltodict ... done
Stored in directory: /home/usr/.cache/pip/wheels/2a/dc/70/da8958d7089d994c8614bc38210f64855f09615e85707bf615
Successfully built xmltodict
Installing collected packages: xmltodict
Successfully installed xmltodict
    
por diegus 22.06.2016 / 10:17
0

export LC_ALL=C

isso fará o truque

    
por 16.05.2019 / 06:15

Tags