今天在一通安装卸载库之后,anaconda 出现了 AttributeError: module ‘boto3’ has no attribute ‘client’ 错误,执行各种命令几乎都会报错,如 conda clean,conda update, conda install,全都报错,navigator 也打不开,依然报错,也就是说整个 anaconda 就像废掉了一样。
最难受的是百度了一下,没有一个适合我的解决方案,有的说要用什么 conda update anaconda-navigator,但显然 conda 的几乎所有命令都已经用不了了,药根本不对症。
最后找到了 conda 的 github 终于得到正解:
首先根据 pip 的提示删除 /anaconda3(你的anaconda目录)/lib/python3.7/site-packages/jmespath*
然后执行
pip uninstall boto3
pip uninstall botocore
pip install boto3
即可,问题得到完美解决。