GNU/Linux >> Linux の 問題 >  >> Ubuntu

Python:PipインストールXmltodictが失敗しますか?

私のubuntuマシンでAnsibleを使用したいと思います。 pingモジュールを使用しようとしましたが、xmltodictが見つからないと文句を言います。 Pythonライブラリ。したがって、pipを使用して不足しているモジュールをインストールしたかったのです。試してみると:

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

Ubuntu16.04LTSを実行しています。どうすればこれを解決できますか?ありがとう

承認された回答:

解決策はここにあります:https://stackoverflow.com/questions/36394101/pip-install-locale-error-unsupported-locale-setting

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

Ubuntu
  1. CentOS / Debian/UbuntuにPythonpipをインストールする方法

  2. UbuntuにPipをインストールする方法–Python用パッケージマネージャー

  3. Ubuntu20.04にpipをインストールする方法

  1. CentOS7にPipをインストールする方法

  2. WindowsでPythonパッケージを管理するためにPIPをインストールする方法

  3. Debian9にPIPをインストールする方法

  1. MacにPipをインストールする方法

  2. CentOS8にPipをインストールする方法

  3. RHEL 8 /CentOS8にpipをインストールする方法