python pip:强制安装忽略依赖项

问题:python pip:强制安装忽略依赖项

有什么方法可以强制安装pip python软件包,而忽略所有无法满足的依赖关系吗?

(我不在乎这样做有多么“错误”,我只需要这样做,除了逻辑和推理之外……)

Is there any way to force install a pip python package ignoring all it’s dependencies that cannot be satisfied?

(I don’t care how “wrong” it is to do so, I just need to do it, any logic and reasoning aside…)


回答 0

点有一个--no-dependencies开关。您应该使用它。

有关更多信息,请运行pip install -h,在这里您将看到以下行:

--no-deps, --no-dependencies
                        Ignore package dependencies

pip has a --no-dependencies switch. You should use that.

For more information, run pip install -h, where you’ll see this line:

--no-deps, --no-dependencies
                        Ignore package dependencies

回答 1

当我尝试librosa使用pippip 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无法删除它。因此,我通过以下代码使用了ignoreof pip的功能:

pip install librosa --ignore-installed llvmlite

确实,您可以使用此规则来忽略您不想考虑的软件包:

pip install {package you want to install} --ignore-installed {installed package you don't want to consider}

When I were trying install librosa package with pip (pip install librosa), this error were appeared:

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.

I tried to remove llvmlite, but pip uninstall could not remove it. So, I used capability of ignore of pip by this code:

pip install librosa --ignore-installed llvmlite

Indeed, you can use this rule for ignoring a package you don’t want to consider:

pip install {package you want to install} --ignore-installed {installed package you don't want to consider}