问题:python pip:强制安装忽略依赖项
有什么方法可以强制安装pip python软件包,而忽略所有无法满足的依赖关系吗?
(我不在乎这样做有多么“错误”,我只需要这样做,除了逻辑和推理之外……)
回答 0
点有一个--no-dependencies
开关。您应该使用它。
有关更多信息,请运行pip install -h
,在这里您将看到以下行:
--no-deps, --no-dependencies
Ignore package dependencies
回答 1
当我尝试librosa
使用pip
(pip install librosa
)安装软件包时,出现此错误:
ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
我尝试删除llvmlite
,但pip uninstall
无法删除它。因此,我通过以下代码使用了ignore
of pip
的功能:
pip install librosa --ignore-installed llvmlite
确实,您可以使用此规则来忽略您不想考虑的软件包:
pip install {package you want to install} --ignore-installed {installed package you don't want to consider}