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

cl25kdpy  于 2022-12-10  发布在  Python
关注(0)|答案(3)|浏览(430)

有没有办法强制安装一个pip python包,忽略它所有不能满足的依赖项?
(我不管这样做有多“错”,我只需要这样做,抛开任何逻辑和推理......)

wnrlj8wa

wnrlj8wa1#

pip有一个--no-dependencies开关。你应该使用它。
有关更多信息,请运行pip install -h,您将看到以下行:

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

ycl3bljg2#

当我尝试安装pip包与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无法删除它。因此,我使用了pipignore功能,代码如下:

pip install librosa --ignore-installed llvmlite

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

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

mpgws1up3#

请尝试以下操作:

pip install --no-deps <LIB_NAME>

pip install --no-dependencies <LIB_NAME>

pip install --no-deps -r requirements.txt

pip install --no-dependencies -r requirements.txt

相关问题