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
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:
Make sure that you have restarted your debug session after making
changes to your launch.json file.
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.
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.
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.
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.
A workaround is to add this to the configuation in launch.json:
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.
If you still seeing the above message, try setting
PYDEVD_DISABLE_FILE_VALIDATION=1
as env variable
I ended up added the environment variable "PYDEVD_DISABLE_FILE_VALIDATION" to my launch.json file. For example: