omegaconf icon indicating copy to clipboard operation
omegaconf copied to clipboard

`incompatible copy of pydevd already imported` when running omegaconf

Open YoniChechik opened this issue 1 year ago • 7 comments

Describe the bug warning appears when running omegaconf:

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.
/root/.vscode-server/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/_vendored/force_pydevd.py:18: UserWarning: incompatible copy of pydevd already imported:
 /venv/lib/python3.11/site-packages/pydevd_plugins/extensions/pydevd_plugin_omegaconf.py
  warnings.warn(msg + ':\n {}'.format('\n  '.join(_unvendored)))

To Reproduce run anything with omegaconf import

Expected behavior this wanring shouldn't happen

Additional context

  • [X] OmegaConf version: omegaconf==2.3.0
  • [X] Python version: 3.11.9
  • [X] Operating system: ubuntu 22.04 in docker
  • [X] Please provide a minimal repro

YoniChechik avatar Jun 03 '24 12:06 YoniChechik

Anyone has solved this somehow? Getting omegaconf via hydra 1.3.2 and having that same annoying warning. (also 2.3.0)

tried setting OC_PYDEVD_RESOLVER:

image

But no change. I dont think omgeconf should force any pydev on the user, at least by default the import should be turned off...

aeon0 avatar Nov 16 '24 09:11 aeon0

Found a solution, uninstall omegaconf, pydevd and debugpy, then delete folder /venv/lib/python3.11/site-packages/pydevd_plugins/extensions and install uninstalled libraries again (I guess that omegaconf should be installed in the end to catch up with installed pydevd and debugpy)

egorsni avatar Dec 12 '24 13:12 egorsni

Found a solution, uninstall omegaconf, pydevd and debugpy, then delete folder /venv/lib/python3.11/site-packages/pydevd_plugins/extensions and install uninstalled libraries again (I guess that omegaconf should be installed in the end to catch up with installed pydevd and debugpy)

I've encountered the same issue as well, but this solution doesn't work for me. Do you have any ideas?

pspdada avatar Dec 14 '24 10:12 pspdada

same here, any solutions?

songlin avatar Mar 02 '25 16:03 songlin

I am getting this issue as well now. I opened an issue with ms-python.debugpy, but they said the fault was on omegaconf.

This is a serious issue as it prevents debugging entirely for me. Is there anything I can do to help look into this?

KyleMylonakisProtopia avatar Jun 25 '25 10:06 KyleMylonakisProtopia

launch your multiprocess debugging with this env to silence the warning:

PYTHONWARNINGS='ignore::UserWarning:debugpy._vendored.force_pydevd'

in launch.json this looks like:

            "env": {
                "PYTHONWARNINGS": "ignore::UserWarning:debugpy._vendored.force_pydevd"
            }

or comment-out the warning in VSCode's force_pydevd.py source code:

find "$HOME/.vscode-server/extensions" -path "*ms-python.debugpy*/bundled/libs/debugpy/_vendored/force_pydevd.py" -exec sed -i 's/^\(\s*\)\(.*warnings\.warn.*_unvendored.*\)$/\1# \2/' {} \;

or delete pydevd_plugin_omegaconf.py (I'm using sudo rm here in case it's in dist-packages, but if yours is in site-packages you can just use rm):

pip show omegaconf | awk '/^Location/ {printf("%s/%s\n", $2, "pydevd_plugins/extensions/pydevd_plugin_omegaconf.py")}' | xargs -n 1 sudo rm

Birch-san avatar Jul 29 '25 12:07 Birch-san

For others out there, I ended up going with the deletion of the pydevd_plugin_omegaconf.py. I recognize that this may not work for all, but it worked for me and I am able to debug again.

I think this issue still remains for the developers if they can fix it, I'm sure the user community would be grateful.

KyleMylonakisProtopia avatar Jul 29 '25 14:07 KyleMylonakisProtopia