最开始想着安装seaborn 用pip 安装好了, pip list 也能显示 seaborn==0.11.2 但是用jupyter 打开发现,弹出一些其他问题,什么numpy、pandas不行(我感觉像是各个包之间不匹配)。 后来尝试用conda安装,结果显示需要更新许多包,然而采用的默认源使得下载失败。不仅下载失败,后面连jupyter都打不开,原因是 缺乏tornado。所以我又用pip重新下载tornado包,就可以打开jupyter了。
解决方法是,给conda换了配置源
最开始换的是:https://pypi.tuna.tsinghua.edu.cn/simple/
发现不行,用 conda config --show-sources 可以查看配置的源
后面切换为默认源 conda config --remove-key channels,然后重新配置
网上找的配置源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
(作者:Ginkgo
链接:https://www.jianshu.com/p/7e663bb0d904
来源:简书)
然后就正常可以 conda install seaborn,下载完之后,我这边打开jupyter结果又显示错误
ImportError: cannot import name 'parse' from 'dateutil.parser' (unknown location)
后来重新安装了一下
pip3 install python-dateutil
就可以正常使用jupyter了,seaborn也能导入了。