- 在此输入代码我当前正在尝试安装 “microsoft/Florence-2-large”模型并遵循文档 在其 github 页面上提供。运行 pip install 时 flash-attn --no-build-isolation 我抛出此错误:
Collecting flash_attn Using cached flash_attn-2.5.9.post1.tar.gz (2.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "C:\Users\manik\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\manik\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manik\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manik\AppData\Local\Temp\pip-build-env-rifgc3eo\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\manik\AppData\Local\Temp\pip-build-env-rifgc3eo\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires self.run_setup() File "C:\Users\manik\AppData\Local\Temp\pip-build-env-rifgc3eo\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\manik\AppData\Local\Temp\pip-build-env-rifgc3eo\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup exec(code, locals()) File "<string>", line 9, in <module> ModuleNotFoundError: No module named 'packaging' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
安装
flash-attn
时遇到的错误是因为你的环境中缺少
packaging
包,而
flash-attn
在构建过程中需要这个包。
以下是解决这个问题的步骤:
-
安装
packaging
包: 打开你的命令行或终端,运行以下命令:
bash
pip install packaging
这会安装
packaging
包及其依赖。
-
重新安装
flash-attn
: 安装完packaging
后,再次运行安装flash-attn
的命令:
bash
pip install flash-attn --no-build-isolation
这次安装应该会成功。
如果问题仍然存在,请尝试以下步骤:
-
升级 pip:
确保你使用的是最新版本的
pip
。 运行pip install --upgrade pip
来升级。 -
创建新的虚拟环境:
在新的虚拟环境中安装
flash-attn
可以避免与其他包的冲突。 -
检查 CUDA 版本:
flash-attn
需要 CUDA 支持。 确保你已经安装了兼容版本的 CUDA 和 cuDNN。
希望这些步骤能帮你解决问题!
标签:python,windows,flash,model,large-language-model From: 78688150