ImportError: cannot import name 'packaging' from 'pkg_resources'

问题1 20240708 安装flash_attn 1.0.4时报错:

ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/mang/micromamba/envs/py39_scgpt/lib/python3.9/site-packages/pkg_resources/init.py

报错原因: 这似乎是最新版本的 setuptools 的问题。类似的报告已经在 github issues 中完成,对我有用的解决方案是将 setuptools 版本指定为 69.5.1即可解决问题,例如:

pip install setuptools==69.5.1

参考: ImportError: cannot import name 'packaging' from 'pkg_resources' when trying to install causal_conv1d

问题2 FileNotFoundError: [Errno 2] No such file or directory: ':/usr/local/cuda:/usr/local/cuda-10.1/bin/nvcc'

解决办法:在.bashrc配置文件中设置好export CUDA_HOME=/usr/local/cuda 即可解决问题

posted @ 2024-07-08 18:14  wuhaoliu  阅读(102)  评论(0)    收藏  举报  来源