Description
使用pip 安装requirement时安装报以下错误:
"""
Collecting flash_attn (from -r requirements.txt (line 14))
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/11/34/9bf60e736ed7bbe15055ac2dab48ec67d9dbd088d2b4ae318fd77190ab4e/flash_attn-2.7.4.post1.tar.gz (6.0 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
/private/var/folders/3p/tghlrh9d7zj9dkjyzdvgn5q40000gn/T/pip-install-nf6ja0in/flash-attn_333cffdeee0440208480fc31b281af97/setup.py:106: UserWarning: flash_attn was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.
warnings.warn(
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/private/var/folders/3p/tghlrh9d7zj9dkjyzdvgn5q40000gn/T/pip-install-nf6ja0in/flash-attn_333cffdeee0440208480fc31b281af97/setup.py", line 198, in
CUDAExtension(
File "/Users//miniconda3/envs/multi/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1130, in CUDAExtension
library_dirs += library_paths(device_type="cuda")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users//miniconda3/envs/multi/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1264, in library_paths
if (not os.path.exists(_join_cuda_home(lib_dir)) and
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/*/miniconda3/envs/multi/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2525, in _join_cuda_home
raise OSError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
torch.__version__ = 2.6.0
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
"""
请问是否是因为不支持苹果Slicon所导致的?如果是,有办法解决这个问题吗?谢谢!