numpy - "Python quit unexpectedly" when plotting dataframe in Jupyter Notebook on macOS 10.14.6 - Stack Overfl

I'm encountering an issue where the Python kernel crashes with the message "Python Quit Unexp

I'm encountering an issue where the Python kernel crashes with the message "Python Quit Unexpectedly" when attempting to plot a simple DataFrame or call an external Python script from a Jupyter notebook. Here are the details:

Environment:

  • Operating System: macOS 10.14.6
  • Python Version: 3.10.16
  • Package Manager: Using UV's package manager to set up the virtual environment
  • Matplotlib Version: 3.10.1
  • NumPy Version: 2.2.3
  • Pandas Version: 2.2.3

Code that Causes the Crash:

import matplotlib.pyplot as plt
import pandas as pd

simple_df = pd.DataFrame({'A': [1, 2, 3, 4, 5], 'B': [5, 4, 3, 2, 1]})
plt.plot(simple_df)
plt.show()

Additional Information:

  • The crash occurs when executing the plt.show() line.
  • The same issue happens when calling another Python file from a notebook cell with identical code.
  • The MacBook is quite old but should still be supported.

Steps Taken:

  • Verified the versions of Matplotlib, NumPy, and Pandas.
  • Tried running the code in a fresh virtual environment.

Question: Has anyone else encountered this issue, and if so, how was it resolved? Are there any known compatibility issues with these library versions on macOS 10.14.6? Any suggestions or workarounds would be greatly appreciated.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744780835a4593329.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信