I am trying to run a python script to run all cells in all notebooks found a directory. It runs fine and I am getting the desired results in the notebook files. However, I want to disable the warnings that are printed to the VSCode cmd terminal when running the script. My code below:
import nbformat
from glob import glob
from nbconvert.preprocessors import ExecutePreprocessor
if __name__ == "__main__":
nb_list = glob("./*.ipynb")
ep = ExecutePreprocessor()
for nb in nb_list:
with open(nb) as f:
nb_r = nbformat.read(f, as_version=4)
ep.preprocess(nb_r)
The console output:
0.00s - Debugger warning: It seems that frozen modules are being used, which may 0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off 0.00s - to python to disable frozen modules. 0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
Tried setting "env": {"PYDEVD_DISABLE_FILE_VALIDATION":"1"} in the launch.json file. Didn't change anything.
Tried setting "pythonArgs": ["-Xfrozen_modules=off"] in the launch.json file. Didn't change anything.
Tried setting warnings.filterwarnings('ignore', module='ExecutePreprocessor'). Didn't change anything.
Tried setting os.environ['PYTHONWARNINGS'] = ''. Didn't change anything.
Tried setting os.environ['PYDEVD_USE_CYTHON'] = '1'. Didn't change anything.
What I haven't tried is setting PYDEVD_DISABLE_FILE_VALIDATION=1. I don't know where to set this, how to set it, and the implications.
Figured out how to "Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation". Adding a user or system environment variable called 'PYDEVD_DISABLE_FILE_VALIDATION' and setting the value to '1' did the job.
Didn't know this is what it meant (newbie alert).