我安装了 python 3.9 和 3.11,但是大多数 pip 包都安装在 3.9 中,我不想转到 3.11
我必须安装 pycurl,但是使用 pip install 无法构建,所以我使用 apt install python3-pycurl,但是它只能安装 3.11
所以我手动下载了 3.9 https://debian.pkgs.org/11/debian-main-amd64/python3-pycurl_7.43.0.6-5_amd64.deb.html
# dpkg --force-all -i python3-pycurl_7.43.0.6-5_amd64.deb
(Reading database ... 476458 files and directories currently installed.)
Preparing to unpack python3-pycurl_7.43.0.6-5_amd64.deb ...
Unpacking python3-pycurl (7.43.0.6-5) over (7.43.0.6-5) ...
dpkg: python3-pycurl: dependency problems, but configuring anyway as you requested:
python3-pycurl depends on python3 (<< 3.10); however:
Version of python3 on system is 3.11.2-1+b1.
Setting up python3-pycurl (7.43.0.6-5) ...
此后 pycurl 运行正常,但 apt 显示错误:
# apt install
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-pycurl : Depends: python3 (< 3.10) but 3.11.2-1+b1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
这不是问题,因为我安装了 3.9 和 3.11,这是一个误报
我必须为 apt 运行 --fix-broken,否则,我无法用 apt 做任何其他事情,运行它之后,它没有修复任何问题,但它破坏了 3.9 版的 pycurl,并将其安装在 3.11 版上
我如何忽略 apt 中未满足的依赖项错误?因为这根本不是问题,如果我不“修复”它,它就会阻止我对 pat 进行任何操作,但实际上它反而会破坏它