每当我在Visual Studio Code中加载Python时,它会告诉我在激活VS IntelliCode支持时出现了一些问题。当我检查“Python”输出窗口时,会有几个错误。由于隐私原因,我已将所有用户文件夹名称的实例替换为“defaultuser”。
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonSendEntireLineToREPL'
> conda --version
> conda info --json
> pyenv root
> python3.7 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> /usr/local/bin/python3 ~/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/local/bin/python2.6' [Error: Command failed: "/usr/local/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/local/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/local/bin/python' [Error: Command failed: "/usr/local/bin/python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/local/bin/python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/bin/python2.6' [Error: Command failed: "/usr/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/local/bin/python2.6' [Error: Command failed: "/usr/local/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/local/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/local/bin/python' [Error: Command failed: "/usr/local/bin/python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/local/bin/python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/usr/bin/python2.6' [Error: Command failed: "/usr/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/usr/bin/python2.6" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Error 2020-12-14 20:15:44: Failed to get interpreter information for '/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python' [Error: Command failed: "/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"
Traceback (most recent call last):
File "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py", line 30, in <module>
runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 1,
signal: null,
cmd: '"/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py" "/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/pythonFiles/interpreterInfo.py"'
}
Starting Jedi Python language engine.
Error 2020-12-14 20:15:44: Failed to activate a workspace, Class name = y, completed in 3283ms, has a falsy return value, Arg 1: <Uri:/Users/defaultuser/Documents/William's Documents/Computer programs/Experiment with stuff_Py>, Return Value: undefined [Error: No matching bindings found for serviceIdentifier: Symbol(ILanguageServerActivator)
Symbol(ILanguageServerActivator) - named: Jedi
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261016
at m (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261313)
at e (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261804)
at Object.t.plan (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:262467)
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259121
at e._get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259030)
at e.getTagged (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257832)
at e.getNamed (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257924)
at a.get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:917230)
at _.createRefCountedServer (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:30661)
at async _.activate (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:28522)
at async Promise.all (index 4)
at async y.activateWorkspace (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:23604)]
Error 2020-12-14 20:15:44: Failure during activation. [Error: No matching bindings found for serviceIdentifier: Symbol(ILanguageServerActivator)
Symbol(ILanguageServerActivator) - named: Jedi
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261016
at m (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261313)
at e (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261804)
at Object.t.plan (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:262467)
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259121
at e._get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259030)
at e.getTagged (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257832)
at e.getNamed (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257924)
at a.get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:917230)
at _.createRefCountedServer (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:30661)
at async _.activate (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:28522)
at async Promise.all (index 4)
at async y.activateWorkspace (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:23604)]
Error 2020-12-14 20:15:44: sendStartupTelemetry() failed. [Error: No matching bindings found for serviceIdentifier: Symbol(ILanguageServerActivator)
Symbol(ILanguageServerActivator) - named: Jedi
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261016
at m (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261313)
at e (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:261804)
at Object.t.plan (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:262467)
at /Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259121
at e._get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:259030)
at e.getTagged (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257832)
at e.getNamed (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:24:257924)
at a.get (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:917230)
at _.createRefCountedServer (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:30661)
at async _.activate (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:28522)
at async Promise.all (index 4)
at async y.activateWorkspace (/Users/defaultuser/.vscode/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:32:23604)]
> pyenv root
> pyenv root
Python interpreter path: /usr/local/bin/python3
> pyenv root
> pyenv root
> pyenv root
> pyenv root
> pyenv root
> pyenv root
> pyenv root
这些错误非常奇怪和复杂,我不知道如何解决它们以便让VS IntelliCode在Python工作。也许你们能够理解其中的所有问题?(顺便提一下,我正在使用Microsoft的Python扩展和版本3.9.0的Python解释器在Mac上的VS Code中工作。)
~ 12月15日更新:我认为值得提到我正在使用macOS Yosemite(v10.10)。~