2016-04-02 10 views
1

)apt-get installでパッケージをインストールしようとするたびに、私は次のエラーが発生します:インストールパッケージを入手できませんでした。E:サブプロセス/ usr/bin/dpkgがエラーコードを返しました(

After this operation, 0 B of additional disk space will be used. 
Do you want to continue? [Y/n] y 
Setting up python-support (1.0.15) ... 
    File "/usr/sbin/update-python-modules", line 52 
    print x 
     ^
SyntaxError: Missing parentheses in call to 'print' 
dpkg: error processing package python-support (--configure): 
subprocess installed post-installation script returned error exit status 1 
Setting up mercurial-common (3.1.2-2+deb8u1) ... 
Traceback (most recent call last): 
    File "/usr/bin/pycompile", line 35, in <module> 
    from debpython.version import SUPPORTED, debsorted, vrepr, \ 
    File "/usr/share/python/debpython/version.py", line 24, in <module> 
    from ConfigParser import SafeConfigParser 
ImportError: No module named 'ConfigParser' 
dpkg: error processing package mercurial-common (--configure): 
subprocess installed post-installation script returned error exit status 1 
dpkg: dependency problems prevent configuration of mercurial: 
mercurial depends on mercurial-common (= 3.1.2-2+deb8u1); however: 
    Package mercurial-common is not configured yet. 

dpkg: error processing package mercurial (--configure): 
dependency problems - leaving unconfigured 
Errors were encountered while processing: 
python-support 
mercurial-common 
mercurial 
E: Sub-process /usr/bin/dpkg returned an error code (1) 

私は現在、自分のマシンでPython 3.4.2を使用しています。

答えて

5

デフォルトのPythonをPython2からPython3に変更しましたか?現在、Debianにはdefault Python2 installationが付属しています。 /usr/sbin/update-python-modulesのようなPythonで書かれたシステムスクリプトは、pythonがPython2のバージョンを実行することを期待しています。デフォルトのPythonをPython3に変更すると、あらゆる種類のスクリプトが中断します。 Python3をデフォルトにした場合、現在の問題を解決する方法は元に戻してPython2をデフォルトに戻すことです。 Python2 print


文ですので、print xは有効です。

Python3でprintは関数なので、関数を呼び出すには引数をかっこで囲む必要があります。したがって、print xprint(x)に変更する必要があります。 print xSyntaxErrorを発生させます:

File "/usr/sbin/update-python-modules", line 52 
    print x 
     ^
SyntaxError: Missing parentheses in call to 'print' 

代わりのシステムのデフォルトのpythonを変更し、Pythonの複数のバージョンの間の/スイッチを管理するためにpyenv or virtualenvを使用しています。

+0

さらに、水銀がpython3で動作することを期待しないでください。厳密にはpython2が必要です。執筆時点では、Python3はまだ水銀をpython3に移植するのに必要なすべてをサポートしていません。 – planetmaker

関連する問題