Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead." #255

Open
bersbersbers opened this issue Jul 10, 2023 · 2 comments

Comments

@bersbersbers
Copy link

Using Visual Studio Code v1.80.0 with the Python extension v2023.12.0 and Python 3.11.4, I often get this warning:

Failed to enable GUI event loop integration for 'qt'
Traceback (most recent call last):
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\matplotlibtools.py", line 30, in do_enable_gui
    enable_gui(guiname)
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 540, in enable_gui
    return gui_hook(app)
           ^^^^^^^^^^^^^
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 176, in enable_qt
    from pydev_ipython.qt_for_kernel import QT_API, QT_API_PYQT5
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\qt_for_kernel.py", line 114, in <module>
    api_opts = get_options()
               ^^^^^^^^^^^^^
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\qt_for_kernel.py", line 102, in get_options
    if mpl is not None and not check_version(mpl.__version__, '1.0.2'):
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\bers\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydev_ipython\version.py", line 33, in check_version
    return LooseVersion(v) >= LooseVersion(check)
           ^^^^^^^^^^^^^^^
  File "C:\Users\bers\.pyenv-win-venv\envs\project_3.11\Lib\site-packages\setuptools\_distutils\version.py", line 55, in __init__
    warnings.warn(
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

At least the warning seems to be related to this piece of code, which is still active on main:

from distutils.version import LooseVersion

@gramster
Copy link

This will break entirely with 3.12 when distutils is removed.

@gramster gramster mentioned this issue Jul 11, 2023
3 tasks
@fabioz
Copy link
Owner

fabioz commented Jul 12, 2023

Agreed it should be done. It should be reasonably simple to replace that with a standalone class (possibly even copying what's needed from distutils).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants