skip to Main Content

I’ve created a virtual environment using venv and I’m using such environment in Visual Studio Code to run a jupyter notebook.

Now, my code stops running and from the log I can read 2 warnings: one of which is

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.

Let’s suppose I want to pass -Xfrozen_modules=off to python to see what happens, how can I do it? I mean: I’m not running python from command line, I’m just pressing Shift+Enter in Visual Studio Code to execute the code cells of my notebook; how can I pass option to python in Visual Studio Code?

2

Answers


  1. Can you not just put "jupyter.jupyterCommandLineArguments": ["-Xfrozen_modules=off"], in your workspace’s .vscode/settings.json?

    Login or Signup to reply.
  2. Find the kernel.json file of the jupyter kernel under the virtual environment folder. It should be in the following path

    ...venvsharejupyterkernelspython3kernel.json
    

    Open the kernel.json file and add the -Xfrozen_modules=off parameter in "argv".

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search