AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1065556
Accepted
po.pe
po.pe
Asked: 2018-08-16 03:54:55 +0800 CST2018-08-16 03:54:55 +0800 CST 2018-08-16 03:54:55 +0800 CST

尝试重新安装后损坏的python依赖项

  • 772

我在我的 ubuntu 18.04 系统上安装了几个 python 并尝试卸载所有必要的并正确重新安装 python3.6

所以我删除了下面列出的所有文件夹,这whereis python可能是个坏主意。

现在,如果我运行sudo apt-get install python3.6它会返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3.6 is already the newest version (3.6.5-3).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3.6-minimal (3.6.5-3) ...
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 0x00007f814f83c740 (most recent call first):
Aborted
dpkg: error processing package python3.6-minimal (--configure):
 installed python3.6-minimal package post-installation script subprocess returned error exit status 134
Setting up python-minimal (2.7.15~rc1-1) ...
/var/lib/dpkg/info/python-minimal.postinst: 4: /var/lib/dpkg/info/python-minimal.postinst: python2.7: not found
dpkg: error processing package python-minimal (--configure):
 installed python-minimal package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of python3.6:
 python3.6 depends on python3.6-minimal (= 3.6.5-3); however:
  Package python3.6-minimal is not configured yet.

dpkg: error processing package python3.6 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.6-dev:
 python3.6-dev depends on python3.6 (= 3.6.5-3); however:
  Package python3.6 is not configured yet.

dpkg: error processing package python3.6-dev (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.6-minimal
 python-minimal
 python3.6
 python3.6-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我尝试更新最小包,sudo apt-get install -f --reinstall python3.6-minimal但返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for python3.6-minimal:amd64

我不是一个真正有经验的 linux 用户,所以我被困在这里。有人知道如何修复我的 python 安装吗?

dpkg dependencies python3 18.04
  • 1 1 个回答
  • 55304 Views

1 个回答

  • Voted
  1. Best Answer
    abu-ahmed al-khatiri
    2018-10-03T02:31:12+08:002018-10-03T02:31:12+08:00

    dpkg: 错误处理包python3.6-minimal(--configure):
    dpkg: 错误处理包python3.6(--configure):
    dpkg: 错误处理包python3.6-dev(--configure):

    您有 3 个 dpkg 软件包错误需要重新配置,接下来要做的一件事

    sudo dpkg --configure -a
    

    我看到你有 4 个包没有升级

    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
    4 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    

    确保所有软件包都已更新和升级,运行

    sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove
    

    如果输出日志说

    Errors were encountered while processing:  
    python3.6-minimal  
    python-minimal  
    python3.6  
    python3.6-dev
    

    尝试输入sudo apt-get install --fix-broken

    如果您在处理该软件包时仍然遇到错误,请尝试清除并删除所有 python 并重新安装,请按照

    sudo apt-get purge python* && sudo apt-get autoclean && sudo apt-get install python*
    

    希望这可以帮助。

    • 10

相关问题

  • 安装 Ubuntu Tweak 的问题

  • 如何将具有依赖项的包上传到我的 PPA?

  • “/var/lib/dpkg/updates”文件夹中存储了什么?

  • 如何删除已卸载包的依赖项?

  • 使用 dpkg 手动安装软件包是否会阻止未来的升级路径?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve