ubutnu apt apt-get报有关python的错误

path --- /usr/bin/pyvenv.cfg....................................................................................................................................................] 
path --- /usr/pyvenv.cfg
path --- /usr/bin/pyvenv.cfg
path --- /usr/pyvenv.cfg
eval_wrong: ['path --- /usr/bin/pyvenv.cfg', 'path --- /usr/pyvenv.cfg', "b'o\\r\\r\\n'"]
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 319, in <module>
    main()
  File "/usr/bin/py3compile", line 290, in main
    compile(files, compile_versions, options.force,
  File "/usr/bin/py3compile", line 201, in compile
    interpreter.magic_number(version), mtime)
  File "/usr/share/python3/debpython/interpreter.py", line 235, in magic_number
    return eval(result)
TypeError: eval() arg 1 must be a string, bytes or code object
dpkg: error processing package libglib2.0-dev-bin (--configure):
 installed libglib2.0-dev-bin package post-installation script subprocess returned error exit status 1
Setting up python3-lockfile (1:0.12.2-2.2) ...
dpkg: error processing package python3-pexpect (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libglib2.0-dev-bin
 python3-lockfile
 python3-filelock
 python3-requests-toolbelt
 python3-pkginfo
 python3-pylev
 python3-virtualenv
 python3-clikit
 python3-virtualenv-clone
 python3-distlib
 python3-webencodings
 python3-platformdirs
 python3-jinja2
 plymouth-theme-ubuntu-text
 python3-packaging
 libglib2.0-dev:amd64
 python3-poetry
 python3-poetry-core
 python3-cryptography
 python3-crashtest
 python3-html5lib
 speedtest-cli
 python3-cachy
 python3-pastel
 python3-cleo
 python3-msgpack
 python3-cachecontrol
 python3-shellingham
 python3-tomlkit
 python3-ptyprocess
 pipenv
 libpoppler-glib-dev
 cloud-init
 python3-pexpect
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

这通常是apt中的python环境有问题了

直接使用

sudo apt purge python3
sudo apt-get purge python3

注意这里使用apt purge 从系统中彻底删除软件包及其所有配置文件。

apt remove不会删除配置文件

进行

apt-get update

apt-get upgrade

发现成功解决bug

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值