2

最新の apt-get アップグレードは次のエラーで失敗しました:

Setting up python2.7-minimal (2.7.3-0ubuntu3.4) ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/local/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/local/lib/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/local/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/lib/python2.7/site.py", line 243, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/local/lib/python2.7/sysconfig.py", line 520, in get_config_var
    return get_config_vars().get(name)
  File "/usr/local/lib/python2.7/sysconfig.py", line 419, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/local/include/python2.7       /pyconfig.h (No such file or directory)
dpkg: error processing python2.7-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 python2.7-minimal

/usr/local/include/python2.7/pyconfig.h が見つからないため、python2.7-minimal の再インストールが失敗します。別のインストールがあります:

root@ely:~# sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/python2.7   60        auto mode*
  1            /usr/bin/python2.7   60        manual mode
  2            /usr/bin/python3     40        manual mode

root@ely:~# whereis python
python: /usr/bin/python3.2mu /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin      
/python /usr/bin/python3.2 /usr/bin/python2.7-dbg-config /usr/bin/python2.7-dbg     
/etc/python2.7 /etc/python /etc/python3.2 /usr/lib/python2.7 /usr/lib/python3.2 /usr/bin
/X11/python3.2mu /usr/bin/X11/python2.7 /usr/bin/X11/python2.7-config /usr/bi/X11/python 
/usr/bin/X11/python3.2 /usr/bin/X11/python2.7-dbg-config /usr/bin/X11/python2.7-dbg 
/usr/local/bin/python3.2m /usr/local/bin/python2.7 /usr/local/bin/python3.2m-config 
/usr/local/bin/python2.7-config /usr/local/bin/python3.2 /usr/local/bin/python3.2-config 
/usr/local/lib/python2.7 /usr/local/lib/python3.2 /usr/include/python3.2mu /usr/include
/python2.7 /usr/include/python2.7_d /usr/include/python3.2 /usr/include/python3.2_d 
/usr/share/python /usr/share/man/man1/python.1.gz

しかし、pyconfig.h は /usr/include/python*.*/ にしかありません (そうあるべきでしょうか?)

何が起こっている?修正方法 (他のパッケージのインストールが影響を受けます)? ありがとう。

4

1 に答える 1

0

ubuntu に python を再インストールします

于 2018-05-02T21:48:42.453 に答える