下载一些安装包时,执行:
pip install -r requirements.txt
PyYAML的版本过低导致一些模块无法安装,直接使用以下命令无法成功卸载PyYAML
pip uninstall PyYAML
ERROR: Cannot uninstall 'PyYAML'. 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.
本人解决方案:可以忽略旧版本强制安装新版本的PyYAML
pip install --ignore-installed PyYAML
这样可以将requirements.txt里需要的东西安装好。但是会出现新旧版本的PyYAML同时存在的问题
想要卸载旧版本的PyYAML,可以先查找文件位置
find /home -name *PyYAML*
再将旧版本的PyYAML文件删掉,我删掉的有
../python3.7/site-packages/PyYAML-3.13-py3.7.egg-info
../anaconda3/pkgs/pyyaml-3.13-py37h14c3975_0/lib/python3.7/site-packages/PyYAML-3.13-py3.7.egg-info