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

DLL load failes after update #356

Closed
Muerio opened this issue Jul 6, 2020 · 30 comments
Closed

DLL load failes after update #356

Muerio opened this issue Jul 6, 2020 · 30 comments
Labels
bug Something isn't working

Comments

@Muerio
Copy link

Muerio commented Jul 6, 2020

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
@karrtikr
Copy link

karrtikr commented Jul 6, 2020

Hi @Muerio 👋

Can you send a screenshot for the terminal, in case it works, and in the other case where it doesn't? I am suspecting the commands sent by the extension might have been changed which is leading to this error?

previous version 2020.6.2

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

@Muerio
Copy link
Author

Muerio commented Jul 7, 2020

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.

@karrtikr
Copy link

karrtikr commented Jul 7, 2020

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

Also,

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

configuration work?

  • 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)

@Muerio
Copy link
Author

Muerio commented Jul 8, 2020

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 # Throws Exception

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.

@karrtikr
Copy link

karrtikr commented Jul 8, 2020

Please have a look at this https://code.visualstudio.com/docs/python/environments#_use-of-the-pythonpath-variable.
Instead of appending to sys.path, you can set the PYTHONPATH environment variable instead. For instance, you can create an .env file with content:

PYTHONPATH=C:\\Program Files\\FreeCAD 0.18\\bin

Then your modules should be picked from the directory.

Meanwhile I'll try to reproduce it.

@Muerio
Copy link
Author

Muerio commented Jul 14, 2020

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

@karrtikr
Copy link

karrtikr commented Jul 20, 2020

@Muerio Apologies for the delay. Unfortunately, I am unable to reproduce this. I was able to successfully debug the file as you can notice. I was using Python 3.6.6 64 bit as well.

image

Can you send me a screenshot of when the error pops up? I am interested in the command the extension sends when you try to debug the file, if any, when you use the following configuration.

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

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

Please send the above command with both versions.

@Muerio
Copy link
Author

Muerio commented Jul 22, 2020

@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"
        },

@karrtikr
Copy link

The commands sent to the terminal have not changed for you, except the extension version. I used the latest extension version in my screenshot, so please update the extension version to the latest one 2020.7.94776

@Muerio
Copy link
Author

Muerio commented Jul 23, 2020

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

@karrtikr
Copy link

Please provide the logs as mentioned in the issue template.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX


Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXXX

@Muerio
Copy link
Author

Muerio commented Jul 23, 2020

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

@karrtikr
Copy link

@Muerio Thanks for your cooperation, however I've run out of ideas here.

Please delete all directories matching ms-python.python-* c:\Users\user.name\.vscode\extensions. The only thing I can think of is one of the extensions there are corrupt, or FreeCAD itself is corrupt? (although that seems unlikely as it's working with older version of the extension)

I'll double check with my team on if they have any other ideas, but if not, I'll have to close this as I cannot reproduce it. I can suggest trying to use a different system and see if you can reproduce it.

@Muerio
Copy link
Author

Muerio commented Jul 23, 2020

@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.

@int19h
Copy link
Contributor

int19h commented Jul 23, 2020

What happens if you just press F5 after that exception gets reported? Depending on the settings, the debugger will report exceptions as they are raised, even if they're eventually handled - you can continue running in this case. If that's what's happening here, you should see "Done" printed anyway.

(It would still be a bug, though, because if FreeCAD is raising the exception internally, and then catching it, it shouldn't be reported.)

@Muerio
Copy link
Author

Muerio commented Jul 24, 2020

@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.

@karrtikr karrtikr transferred this issue from microsoft/vscode-python Aug 4, 2020
@karrtikr karrtikr removed their assignment Aug 4, 2020
@fabioz
Copy link
Collaborator

fabioz commented Aug 6, 2020

I installed FreeCAD here and I couldn't reproduce this (i.e.: the import works for me with Python 3.6 with the debugger in place).

So, let's see if we can get some additional info to diagnose the issue:

  1. Can you provide some logging from the debugger when you have that error?

i.e.:

  • Open VS Code
  • Select the command Extensions: Open Extensions Folder
  • Locate the Python extension directory, typically of the form ms-python.python-2020..***
  • In that directory ensure you do not have any debug*.log files, if you do, please delete them
  • Go back into VS Code and modify your launch.json to add the setting "logToFile": true, see below:
"version": "0.2.0",
"configurations": [
    {
        "name": "Python: Current File (Integrated Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "stopOnEntry": true,
        "console": "integratedTerminal",
        "logToFile": true
    },
  • Start debugging
  • When done, go back into the extension directory and upload the debug*.log files into this GitHub issue.
  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)?

i.e.: Run the code below and provide the output in each case:

import sys

sys.path.append("C:\\Program Files\\FreeCAD 0.18\\bin")
sys.path.append("C:\\Program Files\\FreeCAD 0.18\\lib")

print(sys.version)

import os
for key, val in sorted(os.environ.items()):
    print(key)
    for v in val.split(os.pathsep):
        print('    %s' % v)  

print('\nsys.path:')
for v in sys.path:
    print('    %s' % (v,)) 
print('\n')

import FreeCAD as App

@Muerio
Copy link
Author

Muerio commented Aug 10, 2020

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

@int19h int19h added the bug Something isn't working label Aug 13, 2020
@fabioz
Copy link
Collaborator

fabioz commented Aug 20, 2020

@Muerio the important part is not the sys.path nor the PYTHONPATH but the other environment variables...

On Windows the important thing is usually the PATH in this case, since it's a DLL load failure, which points to some misconfiguration in your own machine (especially because it was not reproducible by me nor karrtikr with what should be the same env).

You should make sure that the env is exactly the same on both cases (when running in this version and in the older version) -- I've seen exotic cases where the problem was a faulty DLL in a completely unrelated place due to a CAD vendor or graphics card messing things or sometimes it can be because of a 32/64 mixup... there are endless possibilities there and if you have it running in one place and not in the other, it usually boils down to making sure you have the exact same environment variables in both places (and that you don't have a 32/64 mixup at any layer -- including VSCode itself or the shell you use).

@Muerio
Copy link
Author

Muerio commented Aug 21, 2020

@fabioz Thank you for getting back to me on this topic. I had a look at the PATH variable and I noticed this:
When changing from version 2020.6.90262 (import working) to version 2020.6.91350 (import no longer works) the following line is added to the top of PATH:

C:\Users\user.name\AppData\Local\Programs\Python\Python36\lib\site-packages\PyQt5\Qt\bin

Since FreeCAD depends on Qt5 I'm guessing that this is the part which breaks the import of FreeCAD in my script.

Since I didn't change any settings or update anything between running your test script this change in PATH comes from updating the Python extension, right?

@int19h
Copy link
Contributor

int19h commented Aug 21, 2020

The extension doesn't tweak path, and doesn't really know anything about PyQt. More likely, whatever installed Python into that particular directory, also added it to PATH.

@Muerio
Copy link
Author

Muerio commented Aug 21, 2020

Why doesn't the PyQt directory show in PATH when using version 2020.6.90262 of the extension?
Since I didn't change any settings the extension should always use the same Python installation, regardless of the extension's version.

@fabioz
Copy link
Collaborator

fabioz commented Aug 21, 2020

Well, the path isn't really changed in debugpy, but maybe there was some change in VSCode - Python?

From what's being said, this seems like a bugfix (the correct thing is probably having that added to the PATH) -- the fact that it doesn't work in this particular use-case appears to be because the separate Qt5 installations are incompatible (so, it's an installation issue on this particular machine, not a problem in general).

@fabioz
Copy link
Collaborator

fabioz commented Aug 21, 2020

One thing I thought about, if you're up to it is keeping the latest VSCode - Python and then just downgrading the debugpy version using a development version (which should even allow to bisect the error and checking if this is actually related to VSCode - Python or debugpy).

If you're up to it, the steps are:

git clone https://github.com/microsoft/debugpy.git
cd debugpy
pwd

Then, in your launch config add:

"debugAdapterPath": "<pwd path>/src/debugpy/adapter"

To check that it actually works, you can put the contents below at the top of your script and make sure it points to the version of the repo.

import debugpy
print(debugpy.__file__)

Then, you can check out a particular tag and see if the code works even with the latest VSCode - Python.

Something as:

git checkout v1.0.0b11
git checkout v1.0.0b12
git checkout v1.0.0rc1
git checkout v1.0.0rc2

@Muerio
Copy link
Author

Muerio commented Aug 24, 2020

I updated VSCode - Python to the latest version 2020.8.103604, cloned debugpy and started going backwards from version v1.0.0.rc2.

git checkout v1.0.0rc2
git checkout v1.0.0rc1
git checkout v1.0.0b12

PyQt directory is listed in the PATH variable and the import of FreeCAD fails.

git checkout v1.0.0b11

PyQt directory is not listed in the PATH variable and the import of FreeCAD succeeds.

I then went back to version 2020.6.91350 of VSCode -Python where this problem started for me.
The behavior is exactly the same: v1.0.0b11 works, newer versions don't.

I had a look at the changes from version b11 to b12 and came across the fix for issue #304.
Do you think this has something to do with the fact, that PyQt gets added to PATH from version b12 and later?

@int19h
Copy link
Contributor

int19h commented Aug 25, 2020

It might be indirectly related, yes! When this setting is "auto" (which is the default), pydevd tries to detect the correct PyQt version by import probing... and perhaps that breaks here because it finds a "wrong" version first? I'm not entirely sure why PATH is different, but perhaps it's the PyQt module in question that's adjusting it as it gets imported...

Anyway, can you try "qt": "none" in your config to see if that helps?

@Muerio
Copy link
Author

Muerio commented Aug 26, 2020

That's it. Adding "qt":"none" to the config in launch.json removed PyQT from PATH and all four mentioned versions work now.
Obviously this also works when removing the "debugAdapterPath" from the config.

@int19h
Copy link
Contributor

int19h commented Aug 26, 2020

I think this might be related to #362, somehow. It's still not clear to me as to why having that entry in PATH makes a difference, regardless of where it comes from, but we might have to reconsider the default in light of these side effects.

@Muerio
Copy link
Author

Muerio commented Aug 26, 2020

Let me know if you want me to test anything else in this context.

For now I added the option "qt":"none" to all my launch configs allowing me to use the latest python extension for VSCode when working with FreeCAD.

@int19h
Copy link
Contributor

int19h commented Sep 23, 2020

We'll track further investigation in #362.

@int19h int19h closed this as completed Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants