【发布时间】:2021-09-18 06:44:45
【问题描述】:
有什么方法可以强制安装 pip python 包,忽略所有无法满足的依赖项?
(我不在乎这样做有多“错误”,我只需要这样做,除了任何逻辑和推理......)
【问题讨论】:
-
你试过
pip install --no-deps <LIB>吗?
有什么方法可以强制安装 pip python 包,忽略所有无法满足的依赖项?
(我不在乎这样做有多“错误”,我只需要这样做,除了任何逻辑和推理......)
【问题讨论】:
pip install --no-deps <LIB>吗?
pip 有一个--no-dependencies 开关。你应该使用它。
如需更多信息,请运行pip install -h,您将在其中看到以下行:
--no-deps, --no-dependencies
Ignore package dependencies
【讨论】:
pip install --no-deps -r requirements.txt
apt-get install --no-install-recommends?
pip install --no-deps /path/to/package 给出消息“正在安装构建依赖项”并尝试安装构建依赖项。
当我尝试使用pip (pip install librosa) 安装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 的pip 的能力:
pip install librosa --ignore-installed llvmlite
确实,您可以使用此规则来忽略您不想考虑的包:
pip install {package you want to install} --ignore-installed {installed package you don't want to consider}
【讨论】:
pip 忽略很多包怎么样?
尝试以下方法:
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
【讨论】: