The same happened to me today. I believe it was a change in the just released v2024.4.0 of the VSCode python extension. Unfortunately, downgrading the extension to the previously working v2024.2.1 did not solve the problem for me. Luckily it was a fairly simple fix for me so we don't have to wait for Fusion to be updated.
All we have to do is edit the pre-run.py file to change "pythonFiles" to "python_files". This script can be found in Fusion by opening Preferences > API and navigating to the "Default Path for Scripts and Add-Ins." From here, we just need to navigate to the ./Python/vscode directory where the script is stored. On a Mac, the full path may look like "/Users/<username_goes_here>/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Python/vscode/pre-run.py". Edit this file and find "pythonFiles" when setting msPythonPath and change it to "python_files". Restart Fusion and you should be good to go with v2024.4.0 of the ms-python.python extension. Here's the full difference:
+++ pre-run.py 2024-04-04
@@ -38,7 +38,7 @@
msPythonPath = os.path.expandvars(msPythons[0][0].path)
index = msPythonPath.rfind('.')
version = int(msPythonPath[index+1:])
- msPythonPath = os.path.join(msPythonPath, 'pythonFiles', 'lib','python')
+ msPythonPath = os.path.join(msPythonPath, 'python_files', 'lib','python')
msPythonPath = os.path.normpath(msPythonPath)
if os.path.exists(msPythonPath) and os.path.isdir(msPythonPath):
return msPythonPath
The reason for this change is described in the vscode-python changelog where it notes Issue #22921 "Rename pythonFiles to python_files". Hope that works for you too!