我正在尝试安装一些 Python 模块,但在使用 python3-dev 时出现错误。
我愿意
sudo apt-get install python3-dev
我收到以下错误:
The following packages have unmet dependencies:
python3-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but it is not going to be installed
Depends: python3.8-dev (>= 3.8.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我做到了
sudo apt-get install libpython3-dev
我得到了错误:
The following packages have unmet dependencies:
libpython3-dev : Dépend: libpython3.8-dev (>= 3.8.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我该如何解决这个问题?两天前它就让我抓狂了!
答案1
以下是帮助您解决问题的一些步骤:
1-尝试启用受限制的&宇宙存储库。
sudo add-apt-repository universe
sudo add-apt-repository restricted
2-进行操作系统更新:
sudo apt update
3-安装软件属性
sudo apt install software-properties-common
4- 添加死蛇仓库:
sudo add-apt-repository ppa:deadsnakes/ppa
5-清理包数据库:
sudo apt-get autoclean
6-解决依赖问题:
sudo apt-get -f install
7-安装您的软件包:
sudo apt-get install python3-dev
答案2
找到了一个更简单的答案。
安装 aptitude
aptitude install vim (或者其他需要 libpython 的软件)
对第一个问题回答“否”(n),然后它会为您提供另一种选择,为您重新安装 python3.8。
解决了!