Dockerfile

RUN echo "source /opt/conda/bin/activate nlp" > ~/.bashrc

生成软链接

ln -s /opt/conda/envs/nlp/bin/python /bin/python

vscode激活默认的conda环境

#方法一 
/root/.local/share/code-server/User/settings.json
添加:
    "python.defaultInterpreterPath": "/opt/conda/envs/nlp/bin/python",
    "python.condaPath": "/opt/conda/envs/nlp/bin/python"
}
#方法二
Ctrl+Shift+P 
搜索:Python: Select Interpreter
选择路径填入上一步的地址中