【问题标题】:After conda update, python kernel crashes when matplotlib is used用seaborn绘图导致python内核崩溃[重复]
【发布时间】:2021-12-15 15:53:46
【问题描述】:

我在 Win10 上使用 Anaconda,当我尝试在包含 seaborn 的 localhost 上执行简单单元时,我在 5 秒内收到死内核消息,重新启动后它只是无限执行 sns 绘图单元。 For example in titanic dataset

使用 Collab 或 Binder No problem with collab 没有这样的问题; No problem using Binder, online Jupyter Notebook

似乎我遗漏了一些明显的东西。 代码:

import seaborn as sns       
import pandas        
import matplotlib.pyplot as plt       
df = sns.load_dataset('titanic')       
df.head()           
sns.countplot(x='sex',data=df) 

      

【问题讨论】:

  • 你能检查一下你的seaborn、python和jupyter版本吗?可以在终端使用conda list查看。
  • @VinsonCiawandy,Seaborn 是 0.11.2,python 是 3.9.7,对于 jupyter: jupyter 1.0.0 ; jupyter_client 7.0.1 ; jupyter_console 6.4.0 ; jupyter_core 4.8.1; jupyterlab_pygments 0.1.2;由于我几个小时前重新安装了操作系统,我想这些是最新版本
  • 你可以尝试将python版本降级到3.8.103.7.9吗?即使在今天(2021 年末)Python 3.9 还没有被采用,因为它与库存在许多兼容性问题。
  • 你这个周末更新conda了吗? (例如conda update --all

标签: python windows matplotlib seaborn jupyter


【解决方案1】:

stackoverflow.com/q/69786885/7758804
在 Python 3.7.10 上重新创建 env 已解决问题

【讨论】:

  • 查看链接的 SO 问题的更新
  • 请不要发布仅链接的答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-02
相关资源
最近更新 更多