1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Visual Studio Enterprise 2019 IntelliSense false positives with Python 3.12, fine...

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have a VS2019 solution with Python projects running on Windows 10. I recently installed Python from 3.12 to upgrade from 3.8. Now I can select either 3.8 or 3.12 in the drop-down menu in my VS2019 toolbar and debug with either one. The programs run properly with either version, but IntelliSense flags a whole bunch of errors in 3.12 that seem like perfectly valid code. When I switch back to 3.8, IntelliSense has no problem with these lines. Here's a brand new project I created in this solution showing an example of this:

    VS2019 screenshot

    In case the screenshot doesn't come through, here's the actual code:

    ns_proc_prefix_char = 'C'
    ns_sb_procs = {'src_amon':f'${ns_proc_prefix_char}MDMN',
    'src_coll':f'${ns_proc_prefix_char}MDCC'
    }
    print(ns_sb_procs)


    In my VS2019 environment, there are IntelliSense errors under the whole quoted value (including quotes) for the f-strings. When I mouse over them, it just says "invalid syntax". I tried rebooting my system and updating VS2019, but these flagged errors aren't going away.

    I doubt this is related, but I wanted to share it just in case. When debugging with Python 3.12, it logs this warning at startup:

    This version of python seems to be incorrectly compiled
    (internal generated filenames are not absolute).
    This may make the debugger miss breakpoints.
    Related bug: http://bugs.python.org/issue1666807


    This is the latest Python 3.12.10 install for Windows that I got directly from Python.org. I was able to add "-Xfrozen_modules=off" to the Interpreter Arguments section of the debug settings to stop that message.

    Continue reading...

Compartilhe esta Página