1

suppose a jupyter file has several imports

import sys
import pandas as pd
import p1
import p2 

however suppose p2 is never used and I want to remove it. The answer to the question for regular python scripts is here and several others. But jupyter files are not regular files so cleaning them up this way might not work. I could not find on how to do this

Question: How can I check for unused import like the example above in a python jupyterlab notebook?

wander95
  • 1,298
  • 1
  • 15
  • 22
  • You might be looking for this library [nbQA](https://github.com/nbQA-dev/nbQA). I found it from [this](https://stackoverflow.com/questions/50358327/using-pylint-in-ipython-jupyter-notebook) post. – Ryno_XLI Jan 20 '23 at 15:40
  • JupyterLab-lsp is another tool you can use – krassowski Jan 22 '23 at 22:27

0 Answers0