profile
viewpoint

issue commentmicrosoft/debugpy

DLL load failes after update

Hello @fabioz

  1. Can you provide some logging from the debugger when you have that error? See the following files: debugger.vscode_412d6c80-296d-4b30-a9cb-515dff48040a.log debugger.vscode_b89e05fc-b4d2-4ba5-9edb-4e650833aac5.log debugger.vscode_22d27e67-822a-48f3-82be-77ec3853fce2.log

Files have been generated with version 2020.6.91350 of the python extension.

  1. Can you provide some more info on your env in the case where it runs (in the command line) vs the case where it doesn't work (in the debugger)?

For security reasons I can't just post all that information here (company policies). Please let me know if you're interested in specific details of the output from the provided code. I will try to get that information to you. For now I can provide the output regarding python.

When running the code with the python extension (same version):

PYDEVD_DEBUG
    True
PYDEVD_DEBUG_FILE
    c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.91350/debugpy.pydevd.log
PYTHONIOENCODING
    UTF-8
PYTHONUNBUFFERED
    1
sys.path:
    c:\Users\user.name\Desktop\Python Test
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\python36.zip
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\DLLs
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib
    C:\Users\user.name\AppData\Local\Programs\Python\Python36
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\win32
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\win32\lib
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\Pythonwin
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\site-packages
    C:\Program Files\FreeCAD 0.18\bin
    C:\Program Files\FreeCAD 0.18\lib

When running the code from command line/powershell:

sys.path:
    C:\Users\user.name\Desktop\Python Test
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\python36.zip
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\DLLs
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib
    C:\Users\user.name\AppData\Local\Programs\Python\Python36
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\win32
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\win32\lib
    C:\Users\user.name\AppData\Roaming\Python\Python36\site-packages\Pythonwin
    C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\site-packages
    C:\Program Files\FreeCAD 0.18\bin
    C:\Program Files\FreeCAD 0.18\lib
Muerio

comment created time in 5 days

issue openedmicrosoft/debugpy

DLL load failes after update

Import of FreeCAD failes after update to version 2020.6.91350. Works with version 2020.6.90262. Running the same code outside of VS Code also works.

Nothing else was changed/updated with the update of the python extension.

Environment data

  • VS Code version: 1.46.1
  • Extension version (available under the Extensions sidebar): 2020.6.91350
  • OS and version: Windows 10 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None
  • Relevant/affected Python packages and their versions: None
  • Relevant/affected Python-related VS Code extensions and their versions: None
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

Import module without error.

Actual behaviour

Module is not imported. Throws exception:

Exception has occurred: ImportError
DLL load failed: The specified procedure could not be found.

Steps to reproduce:

The following code throws the ImportError exception when extension version 2020.6.91350 is used. Doesn't throw any exception when used with previous version 2020.6.90262

import sys

# Append FreeCAD's bin/lib directory to sys.path
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\bin")
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\lib")

import FreeCAD as App

created time in 10 days

issue commentmicrosoft/vscode-python

DLL load failes after update

@int19h This is the full traceback when pressing F5 with the newest version of the python extension:

PS C:\Users\user.name\Desktop\Python Test>  & 'python' 'c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy\launcher' '49640' '--' 'c:\Users\user.name\Desktop\Python Test\test.py'
Traceback (most recent call last):
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
    cli.main()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 267, in run_file
    runpy.run_path(options.target, run_name=compat.force_str("__main__"))
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\Desktop\Python Test\test.py", line 6, in <module>
    import FreeCAD as App
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

"Done" is not printed and to me it doesn't look like a problem with FreeCAD.

Muerio

comment created time in 21 days

issue commentmicrosoft/vscode-python

DLL load failes after update

@karrtikr Thank you

I deleted the directories but it didn't help.

I will keep an eye on it and try with upcoming versions and let you know, if anything changes.

Muerio

comment created time in 22 days

issue commentmicrosoft/vscode-python

DLL load failes after update

I created the logs as described for all three versions we discussed in this thread and made sure to enable source map support after each extension install.

The Python output showed nothing for the older versions and for version 2020.7.94776 only showed linting messages. Developer console showed no errors for Version 2020.6.90262. For the other versions I attached the log files.

Let me know if you need further information.

Version 2020.6.90262 Debug Console

PS C:\Users\user.name\Desktop\Python Test>  & 'C:\Users\user.name\AppData\Local\Programs\Python\Python36\python.exe' 'c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\lib\python\debugpy\launcher' '50345' '--' 'c:\Users\user.name\Desktop\Python Test\test.py'
FreeCAD 0.18, Libs: 0.18R4 (GitTag)
Done

Output Python

Developer Console

Version 2020.6.91350 Debug Console

PS C:\Users\user.name\Desktop\Python Test>  & 'C:\Users\user.name\AppData\Local\Programs\Python\Python36\python.exe' 'c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy\launcher' '50259' '--' 'c:\Users\user.name\Desktop\Python Test\test.py'
Traceback (most recent call last):
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
    cli.main()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 267, in run_file
    runpy.run_path(options.target, run_name=compat.force_str("__main__"))
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\Desktop\Python Test\test.py", line 6, in <module>
    import FreeCAD as App
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

Output Python

Developer Console 2020-6-91350.log

Version 2020.7.94776 Debug Console

Traceback (most recent call last):
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.94776\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
    cli.main()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.94776\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.94776\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 267, in run_file
    runpy.run_path(options.target, run_name=compat.force_str("__main__"))
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\user.name\Desktop\Python Test\test.py", line 6, in <module>
    import FreeCAD as App
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

Output Python:

cwd: c:\Users\user.name\Desktop\Python Test
> ~\AppData\Local\Programs\Python\Python36\python.exe c:\Users\user.name\.vscode\extensions\ms-python.python-2020.7.94776\pythonFiles\pyvsc-run-isolated.py pylint --additional-builtins=App,Sketcher,Part,Gui,PySide,FreeCADGui --extension-pkg-whitelist=FreeCAD,ImportGui,Part,Sketcher,Import,Mesh --disable=C0330 --max-line-length=150 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Users\user.name\Desktop\Python Test\test.py"
cwd: c:\Users\user.name\Desktop\Python Test
##########Linting Output - pylint##########
************* Module test
8,0,convention,missing-final-newline:Final newline missing
1,0,convention,missing-module-docstring:Missing module docstring
6,0,error,import-error:Unable to import 'FreeCAD'
6,0,convention,wrong-import-position:Import "import FreeCAD as App" should be placed at the top of the module
6,0,warning,unused-import:Unused FreeCAD imported as App

----------------------------------------------------------------------

Your code has been rated at -12.50/10 (previous run: -12.50/10, +0.00)

Developer Console 2020-7-94776.log

Muerio

comment created time in 23 days

issue commentmicrosoft/vscode-python

DLL load failes after update

I updated to the latest version, but the error remains. 94776

Muerio

comment created time in 23 days

issue commentmicrosoft/vscode-python

DLL load failes after update

@karrtikr I just now had the chance to create the screenshots for you. For privacy reasons I had to black out the user-folder name.

Working with version 90262: 90262 Not working with version 91350: 91350

Debug configuration was the same in both cases:

        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
Muerio

comment created time in 23 days

issue commentmicrosoft/vscode-python

DLL load failes after update

@karrtikr did you have any "luck" reproducing the error?

Muerio

comment created time in a month

issue commentmicrosoft/vscode-python

DLL load failes after update

Unfortunately I am unable to reproduce this issue, can you provide small reproducible example project, which I can try to reproduce this?

The following code is enough to produce the error:

import sys

# Append FreeCAD's bin/lib directory to sys.path
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\bin")

import FreeCAD as App


print("Done")

C:/Program Files/FreeCAD 0.18/ is the installation directory for FreeCAD version 0.18.4. The files are available here: FreeCAD 0.18.4 I'm using the 64-bit variant.

  • Does debugging the file using,
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },

configuration work?

No, it results in the same exception.

  • Does running the file in terminal works? (Using the green button on the top right corner, or try using Run python file in terminal command from command palette)

Yes, this works. That's why I suspected a bug in the python extension.

Muerio

comment created time in a month

issue commentmicrosoft/vscode-python

DLL load failes after update

Hi @karrtikr

Can you send a screenshot for the terminal, in case it works, and in the other case where it doesn't? I'm not sure which terminal you want me too screenshot. The Python output terminal only shows pylint commands. The external terminal opened by running my code shows no commands at all, just my output.

I run my code in debug mode using the following configuration in the launch.json: { "name": "Python: Manager", "type": "python", "request": "launch", "program": "${workspaceFolder}/manager.py", "console": "externalTerminal", "postDebugTask": "clean_temp" }

previous version 2020.6.2

There's no such version. Are you sure that's the correct one?

I updated the version number for the working extension. In the changelog in VS Code it's numbered 2020.6.2 wich is 2020.6.90262 on github.

Muerio

comment created time in a month

issue openedmicrosoft/vscode-python

DLL load failes after update

Import of FreeCAD failes after update to version 2020.6.91350. Works with version 2020.6.2. Running the same code outside of VS Code also works.

Nothing else was changed/updated with the update of the python extension.

Environment data

  • VS Code version: 1.46.1
  • Extension version (available under the Extensions sidebar): 2020.6.91350
  • OS and version: Windows 10 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None
  • Relevant/affected Python packages and their versions: None
  • Relevant/affected Python-related VS Code extensions and their versions: None
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

Import module without error.

Actual behaviour

Module is not imported. Throws exception:

Exception has occurred: ImportError
DLL load failed: The specified procedure could not be found.

Steps to reproduce:

The following code throws the ImportError exception when extension version 2020.6.91350 is used. Doesn't throw any exception when used with previous version 2020.6.2

import sys

# Append FreeCAD's bin/lib directory to sys.path
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\bin")
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\lib")

import FreeCAD as App

created time in a month

more