升级到Ubuntu 14.x后重新安装pip?

升级到Ubuntu 14.x后重新安装pip?,pip,ubuntu-14.04,apt-get,Pip,Ubuntu 14.04,Apt Get,我在Ubuntu 14.x上。我正在尝试重新安装pip。包似乎处于不一致的状态。(可能是我之前手动删除了一些文件的结果。)重新安装不起作用,我对通过apt get强制删除包犹豫不决。如何进行 如果我尝试删除pip包,则会出现以下错误: $ sudo apt-get remove python-pip Reading package lists... Done Building dependency tree Reading state information... Done The

我在Ubuntu 14.x上。我正在尝试重新安装pip。包似乎处于不一致的状态。(可能是我之前手动删除了一些文件的结果。)重新安装不起作用,我对通过apt get强制删除包犹豫不决。如何进行

如果我尝试删除pip包,则会出现以下错误:

$ sudo apt-get remove python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-chardet-whl python-colorama python-colorama-whl python-distlib
  python-distlib-whl python-html5lib python-html5lib-whl python-pip-whl
  python-requests-whl python-setuptools-whl python-six-whl python-urllib3-whl
  python-wheel
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  python-pip
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 477 kB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: error processing package python-pip (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt-get install --reinstall python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/97.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package python-pip.
(Reading database ... 71400 files and directories currently installed.)
Preparing to unpack .../python-pip_1.5.4-1ubuntu4_all.deb ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
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 while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
如果我随后尝试清理已安装的pip版本,则会出现以下错误:

$ sudo apt-get remove python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-chardet-whl python-colorama python-colorama-whl python-distlib
  python-distlib-whl python-html5lib python-html5lib-whl python-pip-whl
  python-requests-whl python-setuptools-whl python-six-whl python-urllib3-whl
  python-wheel
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  python-pip
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 477 kB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: error processing package python-pip (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt-get install --reinstall python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/97.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package python-pip.
(Reading database ... 71400 files and directories currently installed.)
Preparing to unpack .../python-pip_1.5.4-1ubuntu4_all.deb ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
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 while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
$sudo apt get install--重新安装python pip
正在阅读软件包列表。。。多恩
构建依赖树
正在读取状态信息。。。多恩
0已升级,0已新安装,1已重新安装,0已删除,0未升级。
1未完全安装或拆除。
需要获取0 B/97.3 kB的存档。
执行此操作后,将使用0 B的额外磁盘空间。
选择以前未选择的包python pip。
(正在读取数据库…71400个当前安装的文件和目录。)
正在准备解包…/python-pip_1.5.4-1ubuntu4_all.deb。。。
文件“/usr/bin/pyclean”,第63行
除了(IOError,OSError),e:
^
SyntaxError:无效语法
dpkg:警告:子进程旧的预删除脚本返回错误退出状态1
dpkg:正在尝试从新包中执行脚本。。。
文件“/usr/bin/pyclean”,第63行
除了(IOError,OSError),e:
^
SyntaxError:无效语法
dpkg:处理归档文件/var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb(--unpack)时出错:
子流程新建预删除脚本返回错误退出状态1
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第35行,在
从支持的debpython.version导入、debsorted、vrepr、\
文件“/usr/share/python/debpython/version.py”,第24行,在
从ConfigParser导入SafeConfigParser
ImportError:没有名为“ConfigParser”的模块
dpkg:清理时出错:
安装的子进程安装后脚本返回错误退出状态1
处理时遇到错误:
/var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb
E:子流程/usr/bin/dpkg返回错误代码(1)
谢谢