怎么解决:INFO: pip is looking at multiple versions of transformers to determine which…
- User
怎么解决:INFO: pip is looking at multiple versions of transformers to determine which version is compatible with other requirements. This could take a while. ERROR: Cannot install -r requirements_4bit.txt (line 20), -r requirements_4bit.txt (line 4), -r requirements_4bit.txt (line 6) and huggingface-hub==0.13.3 because these package versions have conflicting dependencies.
The conflict is caused by: The user requested huggingface-hub==0.13.3 datasets 2.8.0 depends on huggingface-hub<1.0.0 and >=0.2.0 evaluate 0.4.0 depends on huggingface-hub>=0.7.0 transformers 4.30.0.dev0 depends on huggingface-hub<1.0 and >=0.14.1
To fix this you could try to:
- loosen the range of package versions you've specified
- remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
- Assistant
可以尝试解决这个问题的方法:
- 放宽您指定的软件包版本范围。
- 删除软件包版本,以允许pip尝试解决依赖冲突。
您可以尝试先使用以下命令升级pip和setuptools:
pip install --upgrade pip setuptools然后使用以下命令安装软件包:
pip install -r requirements_4bit.txt --use-deprecated=legacy-resolver如果仍然出现相同的错误,则可以尝试删除requirements_4bit.txt中的版本限制,或者您可以手动安装每个软件包并升级到符合要求的版本。
- User
怎么解决:ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts. mdit-py-plugins 0.3.3 requires markdown-it-py<3.0.0,>=1.0.0, but you'll have markdown-it-py 3.0.0 which is incompatible. google-auth 2.20.0 requires urllib3<2.0, but you'll have urllib3 2.0.3 which is incompatible. ray 2.5.0 requires grpcio<=1.51.3,>=1.32.0; python_version < "3.10" and sys_platform != "darwin", but you'll have grpcio 1.54.2 which is incompatible.
- Assistant
该错误提示说明了PIP的旧版本依赖解析器没有考虑到依赖关系冲突,导致发生了冲突。解决这种问题的方法是:
- 升级PIP版本
您可以首先升级您的PIP版本,使用以下命令:
pip install --upgrade pip- 使用新的依赖解析器
在PIP版本20.3以上中,新的依赖解析器是默认开启的,但旧的依赖解析器仍然可以使用下面的命令:
pip install --use-deprecated=legacy-resolver- 解决依赖冲突
在升级您的PIP或者使用新的依赖解析器后,您可以尝试安装依赖包时使用参数
-U或者--upgrade来尝试升级已安装的包。例如:pip install -r requirements.txt -U如果仍然存在依赖冲突的话,您可以查看您的requirements.txt文件,并尝试放宽版本限制,或者手动安装每个软件包并升级到符合要求的版本。特别是对于一些必要版本之间存在无法兼容的变化时,您需要根据您的程序所需要的版本要求调整版本限制。