skip to Main Content

Trying to use the multiprocessing module to run some code. I need to use the python debugger to pass ‘-Xfrozen_modules=off’ but using args or pythonArgs in launch.json doesn’t seem to work.

0.01s - 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.

I passed ‘-Xfrozen_modules=off’ using args and pythonArgs in launch.json but that didn’t work.

Python 3.11.2

4

Answers


  1. Hello @a778h6
    Welcome to the stackoverflow.

    In regards to your query, you can try below steps. I hope this will help you.

    The -Xfrozen_modules=off flag is used to disable the freezing of modules when using the Python interpreter. However, it may not work as expected when using the VS Code debugger.

    If you are still seeing the warning message about frozen modules even after passing the -Xfrozen_modules=off flag using the args or pythonArgs configuration in your launch.json file, you can try the following:

    1. Make sure that you have restarted your debug session after making
      changes to your launch.json file.

    2. Try adding the -Xdev flag to your pythonArgs configuration in
      launch.json. This flag is used to disable the use of optimized .pyc
      files, which can sometimes cause issues when debugging.

    3. If you are using an extension like the Python extension for VS Code,
      try updating to the latest version to ensure that you have the
      latest bug fixes and features.

    4. If none of the above solutions work, you can try using a different
      debugger, such as pdb or ipdb, which may be better suited for
      debugging code that uses frozen modules.

    Keep in mind that frozen modules are read-only and cannot be modified at runtime, so you may need to adjust your debugging approach accordingly.

    Login or Signup to reply.
  2. Note that this is not an error, but a warning. This has been solved in May last year in github.

    The resolutions have been mentioned with the warning.

    Please pass -Xfrozen_modules=off to python to disable frozen modules.

    A workaround is to add this to the configuation in launch.json:

    "pythonArgs": ["-Xfrozen_modules=off"],
    

    Please check whether your launch.json is correct.

    BTW, this issue in github is only for python3.11.0, which may also be related to the python version. You can try to use python3.11.0 for comparison.

    If this is a question specific to python 3.11.2, please submit it to developer in github.

    Login or Signup to reply.
  3. If you still seeing the above message, try setting

    PYDEVD_DISABLE_FILE_VALIDATION=1

    as env variable

    Login or Signup to reply.
  4. I ended up added the environment variable "PYDEVD_DISABLE_FILE_VALIDATION" to my launch.json file. For example:

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Python: Current File",
                "type": "python",
                "request": "launch",
                "program": "${file}",
                "console": "integratedTerminal",
                "justMyCode": true,
                "env": {
                    "PYDEVD_DISABLE_FILE_VALIDATION": "1"
                  }
            }
        ]    
    }
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search