Troubleshooting#

Preface#

Some common issues you might encounter and how to tackle them.

Resetting the API key#

You can reset the API key by deleting the config file:

rm ~/.tradingstrategy/settings.json

Resetting the download cache#

Downloaded files might get corrupted e.g. due to a partial download.

You can see a message like:

OSError: Could not open parquet input source '<Buffer>': Invalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.

To fix this issue, you can remove all files in the download cache.

rm -rf ~/.cache/tradingstrategy/

Apple macOS on M1 ARM CPUs#

Some dependencies, namely numpy are notorious difficult to install on new M1 CPU based Macs. Here are some instructions for Macs only:

Before running installer, make sure you use OpenBLAS correctly from Homebrew:

Running Jupyter notebooks with pdb based debuggers#

You can run the notebooks from console:

Then any pdb or ipdb breakpoints will work correctly.

Manually setting up Jupyter kernel for Visual Studio Code#

Create kern

# First activate virtual env
python3 -m ipykernel install --user --name=testx

Then

Visual Studio Code IOPub limit issue#

You might need ot increase the kernel IOPub limits. The only way to do this for now is to start the kernel from the command line and then give it this as an option.

# Default is 1000/s
jupyter server --ServerApp.iopub_msg_rate_limit 10000

Then use Visual Studio Code or PyCharm “Connect to remote kernel” feature to connect this kernel you started from the command line yourself. Then run the notebook.

PyCharm using a remote kernel#

PyCharm “Managed kernel” option fail to run notebooks. You can work around this by launching Jupyter server in terminal and create “remote kernel” option:

poetry shell
jupyter server --ServerApp.iopub_msg_rate_limit 10000
  • Get the URL with the access token

  • Add new kernel in PyCharm

  • Switch to this kernel