Troubleshooting
Common Issues & Solutions
Jupyter / Kernel Issues
"Kernel died" or "Connection lost"
Symptoms: Jupyter stops responding or crashes.
Solutions:
- Restart the kernel: Kernel → Restart in Jupyter menu.
- Ensure you activated the virtual environment before launching Jupyter.
- Check available system memory; large datashader computations consume RAM.
- Update Jupyter:
pip install --upgrade jupyter ipykernel.
"ImportError: No module named 'X'" or "ModuleNotFoundError"
Symptoms: A cell fails with ImportError or ModuleNotFoundError for a library.
Solutions:
- Install the missing package:
pip install <package_name>orpip install -r requirements.txtfor full environment. - Ensure the virtual environment is activated:
which pythonshould show.venv/bin/python. - Restart the kernel after installing: Kernel → Restart.
- Verify the package is in your environment:
pip list | grep <package_name>.
Plotting Issues
Plots not showing inline
Symptoms: Code runs but no plot appears in the notebook.
Solutions:
- Ensure
%matplotlib inlineis in the setup cell and has been executed (it's in cell 1). - Verify
import matplotlib.pyplot as pltis run before plotting. - Confirm matplotlib backend is set:
%matplotlib inlineshould precede all plotting commands. - For Jupyter Lab, ensure the Lab extensions are up to date:
jupyter labextension list.
"No module named 'datashader'"
Symptoms: Datashader cell fails.
Solutions:
- Install datashader:
pip install datashader colorcet. - Restart the kernel.
- The notebook includes a fallback to Matplotlib hexbin.
Plotly charts show as blank boxes
Symptoms: Interactive plots don't render.
Solutions:
- Check browser console (F12) for JavaScript errors.
- Ensure JavaScript is enabled in your browser.
- Plotly requires an internet connection (CDN mode) unless you specify a local mode.
- Try exporting to HTML: the notebook handles this automatically.
Export Issues
"nbconvert: command not found"
Symptoms: jupyter nbconvert --to pdf ... fails.
Solutions:
- Ensure nbconvert is installed:
pip install nbconvert. - Verify you're in the virtual environment.
- Use the full path:
/path/to/.venv/bin/jupyter nbconvert ....
PDF export fails with LaTeX errors
Symptoms: jupyter nbconvert --to pdf produces errors like "xelatex not found."
Solutions:
- Install LaTeX (see Installation).
- Use alternative export methods (HTML + browser print, or Chromium headless).
- Try
--debugflag for detailed error messages.
Chromium headless produces blank or corrupted PDF
Symptoms: PDF is blank, garbled, or partially rendered.
Solutions:
- Verify the HTML file opens correctly in a browser.
- Check for complex CSS or JavaScript that may not be supported.
- Try with explicit margins:
--print-to-pdf-margin-top=10. - Upgrade Chromium:
apt update && apt install chromium-browser(Linux).
Performance Issues
Notebook is very slow
Symptoms: Cells take a long time to execute.
Solutions:
- The datashader example creates a large synthetic dataset. Reduce
mult=2000to a smaller value. - Disable inline plotting if not needed (no
%matplotlib inline). - Reduce plot resolution or number of points.
- Close unused tabs/applications to free system memory.
Animation export is very slow
Symptoms: anim.save() takes minutes or doesn't complete.
Solutions:
- Reduce number of frames:
frames=100instead of200. - Use GIF instead of MP4 (simpler encoding).
- Ensure ffmpeg is properly installed and on PATH.
Environment Issues
Virtual environment not activating
Symptoms: source .venv/bin/activate doesn't seem to work.
Solutions:
- Verify the venv exists:
ls -la .venv/. - Check shell type:
echo $SHELL. - For bash:
. .venv/bin/activate(dot-space prefix). - For PowerShell (Windows):
.\.venv\Scripts\Activate.ps1. - Check permissions:
chmod +x .venv/bin/activate.
Different Python versions conflicting
Symptoms: python and python3 point to different versions; notebooks use the wrong interpreter.
Solutions:
- Always use the venv Python:
which pythonshould show.venv/bin/python. - Create venv with explicit version:
python3.10 -m venv .venv. - In Jupyter, select the kernel from the venv: Kernel → Change Kernel.
Getting Help
- Jupyter docs: jupyter.readthedocs.io
- Matplotlib FAQ: matplotlib.org/faq
- Seaborn: seaborn.pydata.org
- Plotly: plotly.com
- GitHub Issues: Report bugs to respective library repositories.
Still Stuck?
- Check error messages carefully; they often suggest the fix.
- Search the library's documentation for your specific error.
- Search GitHub issues for similar problems.
- Consider running a fresh venv and re-installing all packages.
Good luck!