意外删除了/usr/lib/python3.6

意外删除了/usr/lib/python3.6

然后尝试通过以下方式卸载 python3.6:

sudo apt-get remove --purge python3.6

成功了。现在我想通过以下方式重新安装 python3.6:

sudo apt-get install python3.6

但这引发了这个错误:

root@ubuntuhost229:/usr: sudo apt-get install python3.6
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Suggested packages:
      python3.6-venv python3.6-doc
    The following NEW packages will be installed:
      python3.6
    0 upgraded, 1 newly installed, 0 to remove and 234 not upgraded.
    Need to get 0 B/244 kB of archives.
    After this operation, 377 kB of additional disk space will be used.
    Selecting previously unselected package python3.6.
    (Reading database ... 193293 files and directories currently installed.)
    Preparing to unpack .../python3.6_3.6.8-1+trusty1_amd64.deb ...
    Unpacking python3.6 (3.6.8-1+trusty1) ...
    Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
    Processing triggers for desktop-file-utils (0.22-1ubuntu1.1) ...
    Processing triggers for mime-support (3.54ubuntu1.1) ...
    Setting up python3.6 (3.6.8-1+trusty1) ...
    Could not find platform independent libraries <prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
    ModuleNotFoundError: No module named 'encodings'

    Current thread 0x00007fecedf18740 (most recent call first):
    Aborted (core dumped)
    dpkg: error processing package python3.6 (--configure):
     subprocess installed post-installation script returned error exit status 134
    Errors were encountered while processing:
     python3.6
    E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么办法可以解决这个问题吗?

相关内容