我无法在Windows 10上全新安装VS Code / Python 3.7.3的情况下使用Python扩展。
VS Code状态栏连续显示消息“ Python扩展加载中……”。
Python以非标准路径安装在c:\ Programs \ Python \ Python37-32 \ python
已经多次卸载了VSCode和python并重新安装。
C:\WINDOWS\system32>which python
/c/Programs/Python/Python37-32/python
打开开发人员工具时,控制台中将显示以下错误。
property 'length' of undefined
at g.update (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:373818)
at g.initialize (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:381134)
at new g (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:372522)
at Function.getInstance (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:372729)
at h.getSettings (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:370264)
at b.initialize (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:83:624877)
at c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:9:93210
at c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:9:93877
at module.exports.t.activate (c:\Users\APCIT\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:9:96601)
at Function._callActivateOptional (c:\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:719:166)
at Function._callActivate (c:\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:718:872)
at define._doActivateExtension.Promise.all.then.e (c:\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:718:79)
答案 0 :(得分:1)
(代表问题作者发布的解决方案)。
确定-我删除了VS Code配置文件文件夹
'%APPDATA%\Roaming\Code
并与miniconda一起安装了新的扩展程序,一切正常。
答案 1 :(得分:1)
这似乎是由其他扩展名引起的烦人的问题。我固定我的最好方法是:
答案 2 :(得分:0)
我也遇到了这个问题。但是我通过更改python文件的位置来修复它。