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

ConfigParserインストールエラー– pythonsetup.pyegg_infoがエラーコード1で失敗しました[解決済み]

エラー: パックスタック コマンドが失敗し、「 ImportError:ConfigParserという名前のモジュールがありません」というエラーメッセージが表示されました。 そこで、Python PIPを使用してConfigParserをインストールしようとしましたが、以下に示すようにインストールが失敗しました。

$pip install ConfigParser
Collecting ConfigParser
 Downloading configparser-3.3.0r2.tar.gz
 Complete output from command python setup.py egg_info:
  from configparser import ConfigParser
 File "/tmp/pip-build-vks_efrb/ConfigParser/configparser.py", line 397
 _KEYCRE = re.compile(ur"%\(([^)]+)\)s")
 SyntaxError: invalid syntax
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vks_efrb/ConfigParser

何が問題なのですか?

解決策:

私はグーグルでpost@StackOverflowを見つけました–ベストアンサーは「 Pythonバージョン3.xでは、 ConfigParser モジュールの名前がconfigparserに変更されました PEP(Python Enhancement Proposals)8の一部として

つまり、インストールされているパッケージはPythonバージョン3.xをサポートしていません。さて、最近Python 3.5.1をインストールしました。古いバージョンのPythonに戻し、エラーが発生するかどうかを確認します。

Pythonのバージョンを確認する

$python --version
Python 3.5.1

そして、 / usr / local / bin / pythonをリンクしていました python3.5へ 。

ls -l /usr/local/bin/python
lrwxrwxrwx 1 root root 9 Dec 11 15:19 /usr/local/bin/python -> python3.5

PythonをPython2.7にリンクする

pythonを元に戻します Pythonバージョン2.7に戻る ConfigParserをインストールできるかどうかを確認します 。

$unlink python
$ln -s /usr/local/bin/python2.7 python
$ls -l python
lrwxrwxrwx 1 root root 24 Jan 6 18:53 python -> /usr/local/bin/python2.7

pipインストールによるConfigParserのインストール

現在、デフォルトの python コマンドはpython2.7にリンクされています 。 ConfigParserをインストールしましょう

$pip install ConfigParser
Collecting configparser
 Using cached configparser-3.3.0r2.tar.gz
Building wheels for collected packages: configparser
 Running setup.py bdist_wheel for configparser
 Stored in directory: /root/.cache/pip/wheels/1a/3e/f9/d34006ad6b1edfe5006aa704f5ee305c553344a7a6d8550c29
Successfully built configparser
Installing collected packages: configparser
Successfully installed configparser-3.3.0.post2

ビオラ!うまくいきました。


Linux
  1. PHP-intlエラー:ICUプレフィックスを検出できないか、失敗しませんでした。 ICUインストールプレフィックスを確認してください[解決済み]

  2. APCインストールエラー– sh:phpize:コマンドが見つかりません[解決済み]

  3. Pythonインストールエラー– surepipの失敗を無視します:pip7.1.2にはSSL/TLSが必要です[解決済み]

  1. Xmanager:システムレジストリからインストール日を取得できませんでした! [解決済み]

  2. 共有ライブラリのロード中にPythonインストールエラーを修正する方法:libssl.so.1.0.0? [解決済み]

  3. Pythonエラー– urllib2 URLError:urlopenエラー不明なURLタイプ:https[解決済み]

  1. Python.hをコンパイルできません–Websockifyのインストールエラー

  2. Pipインストールは「コマンド」pythonSetup.pyEgg_info「エラーコード1で失敗しました」を提供しますか?

  3. RPM:パッケージのインストール エラー:cpio:読み取りに失敗しました