vscode打开tensorboard时报错:We failed to start a TensorBoard session due to the following error: Command failed: conda activate pytorch && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/zhangyulan/.vscode-server/extensions/ms-python.python-2022.14.0/pythonFiles/printEnvVariables.py CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’. To initialize your shell, run $ conda init <SHELL_NAME> Currently supported shells are: - bash - fish - tcsh - xonsh - zsh - powershell See ‘conda init --help’ for more information and options. IMPORTANT: You may need to close and restart your shell after running ‘conda init’.
出现上述问题的主要原因,是由于版本更新导致的。
解决方法:
1.确认在 .vscode-server/bin目录下,把xxxx-lock xxx这个lock文件删除,如果本身没有就不用删。文件如下图所示:
2.把vscode的python和pylance扩展分别退回到2022.14.0和2022.9.10,即一个月前的版本。但我自己退回到一个月前的版本不行,退回到了一年前的版本就可以了。