首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到py3compile的ubuntu升级问题

找不到py3compile的ubuntu升级问题
EN

Ask Ubuntu用户
提问于 2019-04-07 07:56:13
回答 3查看 20.2K关注 0票数 7

Ubuntu: 18.04

当我尝试执行sudo apt-get upgrade时,它会给出以下错误:

代码语言:javascript
运行
复制
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libpython3.7-minimal libpython3.7-stdlib
Use 'sudo apt autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 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-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
 installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)

但是建议推荐的sudo apt autoremove也显示了错误:

代码语言:javascript
运行
复制
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  libpython3.7-minimal libpython3.7-stdlib
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 12.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 178285 files and directories currently installed.)
Removing libpython3.7-stdlib:amd64 (3.7.1-1~18.04) ...
Removing libpython3.7-minimal:amd64 (3.7.1-1~18.04) ...
Setting up python3-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
 installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)

因此,看起来py3compile存在一些问题,但却找不到。我尝试sudo apt-get -f install,它的结尾是:

代码语言:javascript
运行
复制
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
 installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)

相同类型的py3compile: not在我尝试sudo apt-get install --reinstall python3-minimal时显示

我是新来的ubuntu,所以我会很高兴在这方面的一些帮助。

EN

回答 3

Ask Ubuntu用户

发布于 2019-05-26 13:39:21

dpkg错误:py编译程序:未找到-堆栈溢出

这个答案帮助了我,希望它能解决一些人的问题。

通过以下方式重新配置所有未打包但未配置的包:

代码语言:javascript
运行
复制
sudo dpkg --configure -a

如果上面的内容没有帮助,请通过以下方法重新安装python3-minimal包:

代码语言:javascript
运行
复制
sudo apt install -f --reinstall python3-minimal

或者,运行:

代码语言:javascript
运行
复制
apt-get download python3-minimal
sudo dpkg -i *python3*.deb
sudo apt install -f

或从.deb下载kernel.org文件,并通过以下方式从该文件中安装:

代码语言:javascript
运行
复制
sudo dpkg -i python3-minimal_*.deb
票数 19
EN

Ask Ubuntu用户

发布于 2020-09-12 18:16:24

我在Ubuntu20.04.1安装py3compile not found时遇到了python3-pip的问题。我按照答案的建议重新安装了python3-minimal,然后再次尝试安装python3-pip,结果成功了!

代码语言:javascript
运行
复制
sudo apt install -f --reinstall python3-minimal

sudo apt install -f --reinstall python3-pip

希望这对将来的人有帮助!

票数 4
EN

Ask Ubuntu用户

发布于 2021-08-23 09:18:17

在我的例子中,我正在升级Ubuntu 16,我的解决方案是将默认的/usr/bin/python设置为python2,因为python3没有所有所需的依赖项。

代码语言:javascript
运行
复制
rm /usr/bin/python /usr/bin/python3
ln -sf /usr/bin/python2.7 /usr/bin/python
票数 -4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1131816

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档