jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
  TEZNKK3IfmPf 2023年11月13日 69 0
 

问题描述

利用Jupyter Notebook开发环境,编写Python代码读取文件时,如出现以下问题

IOPub data rate exceeded. The notebook server will temporarily stop
sending output to the client in order to avoid crashing it. To change
this limit, set the config variable
--NotebookApp.iopub_data_rate_limit.

Current values: NotebookApp.iopub_data_rate_limit=1000000.0
(bytes/sec) NotebookApp.rate_limit_window=3.0 (secs)

翻译:
超过IOPub数据速率。
为了避免崩溃,笔记本服务器将暂时停止发送到客户端。
若要更改此限制,请设置配置变量`–NotebookApp.iopub_data_Rate_Limit。
现值:
NotebookApp.iopub_data_Rate_limit=1000000.0(字节/秒)

jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)

分析问题

根据翻译:直白一点就是需要设置NotebookApp.iopub_data_Rate_limit默认速率

解决办法

1.怎么设置呢,肯定是要找到这个文件,所以第一步我们先打开anaconda
jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
2.输入命令:jupyter notebook --generate-config
目的是查看文件的路径(一般情况下是在用户的.jupyter目录下面)
jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
3.右键选择记事本打开
jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)

4.ctrl+F 搜索iopub关键字(不然很难找到,浪费时间),改完之后重启jupyter就行。
jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
命令更改:jupyter notebook --NotebookApp.iopub_data_rate_limit=1000000000
命令更改完之后会自动重新启动的。

jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
5.测试
将我们的报错的数据再一次读取试试

import pandas as pd
df=pd.read_excel('Sample - Superstore.xls')
print(df.to_string())

jupyter notebook 报错:Current values: NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)

完美解决。

总结

其实默认的NotebookApp.iopub_data_rate_limit设置了我们速率,加大就行

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
TEZNKK3IfmPf