如何修复删除的python ubuntu18.04

在尝试安装ROS2时误删Python,本文详细记录了在Ubuntu 18.04上重新安装Python3的过程,包括下载所需包、清理旧文件、从包中提取文件并手动安装,以及验证Python3是否成功修复。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本来想练习一下slam 比赛, 结果没成想能巧成拙。 安装melodic for python3  on Ubuntu 18,老是报各种错误。 之前安装过melodic,没有什么问题, 并将教程跑了一下。主要是试图安装ros2,   导致了各种冲突。

着急之下,英文网上找了一个教程安装melodic for python3  on Ubuntu 18,当时也没有想,就照着做了。

不小心,讲之前安装的Python删除了。

这导致后来各种坑。

 

最后我只好重装python2.7. 

装python3.7 的时候,出现pycompile-not-found, 搜到了这个网页,解决了python3.7安装问题。

 

主要是记录一下。

 

挖的大坑,填一多半,还有其他broken issues,需要修复。

 

Reconstruction of Python3 in Debian entails three critical things:

  • Restoring py3compile script (for most of you, you already have this)
  • Restoring libpython3.7
  • Restoring python binary

One could do the RE-copying of /usr[/local]/lib directory from another working Debian host/system. But this time, I shall detail the steps from within the broken host in question (as if you do NOT have another working host).

Step 1 - Do

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值