1

The following code snippet

import json
import time
import requests

resp = requests.get(f'https://blockchain.info/blocks/{round(time.time() * 1000)}?format=json')
hashes = [b['hash'] for b in resp.json()['blocks']]
hashes = hashes[:1]

for hash in hashes:
    resp = requests.get(f'https://blockchain.info/rawblock/{hash}')
    print(json.dumps(resp.json(), indent=2))

… throws the following error in Pycharm:

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)

I know of alledged dups. This question is about running the notebook in PyCharm. I run the notebook as managed server. How can I fix this?

ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103

1 Answers1

0

When you run a notebook in PyCharm, you should be able to look at exactly how PyCharm launched the server. See their help documentation for an up to date example of where to click in PyCharm to [see these details] (https://www.jetbrains.com/help/idea/configuring-jupyter-notebook.html#run-notebook).

When you have located the line (mine looks like this):

/Users/<me>/PycharmProjects/aoc_2022/venv/bin/python -m jupyter notebook --notebook-dir=/Users/<me>/PycharmProjects/aoc_2022 --no-browser

Then you can use the first part of it to determine which Jupyter config file is being used. For example, take the line up until jupyter and then remove the rest, replacing it with --config-dir. Enter the line in your PyCharm "Terminal" (which should automatically open with the same Python environment your current project is in).

/Users/<me>/PycharmProjects/aoc_2022/venv/bin/python -m jupyter --config-dir

It should return something like this:

/Users/<me>/.jupyter

Once you have located that file, you can open it (in PyCharm if you like!) and then follow the instructions from this answer to the question you found as a possible dupe.

I hope that helps connect the dots for how to get PyCharm's managed Jupyter server to honor a settings/config change.

kries
  • 164
  • 1
  • 9